audiopolicy: fix attributes match helper function

Regression caught on Attributes referred by their flags only
(like BT SCO).
Client may have more flags than the product strategy, checks
to be done on all the flags of the product strategy are requested
by the client.

Bug: 130284799
Test: make

Change-Id: Ie8d41a592342bc0a7a0326f9766e7e7503154e62
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
gugelfrei
François Gaffie 5 years ago committed by Eric Laurent
parent 698d353587
commit 393f0e05e3

@ -250,10 +250,7 @@ AudioTrack::AudioTrack(
mPreviousSchedulingGroup(SP_DEFAULT),
mPausedPosition(0)
{
mAttributes.content_type = AUDIO_CONTENT_TYPE_UNKNOWN;
mAttributes.usage = AUDIO_USAGE_UNKNOWN;
mAttributes.flags = 0x0;
strcpy(mAttributes.tags, "");
mAttributes = AUDIO_ATTRIBUTES_INITIALIZER;
(void)set(streamType, sampleRate, format, channelMask,
frameCount, flags, cbf, user, notificationFrames,
@ -286,10 +283,7 @@ AudioTrack::AudioTrack(
mPausedPosition(0),
mSelectedDeviceId(AUDIO_PORT_HANDLE_NONE)
{
mAttributes.content_type = AUDIO_CONTENT_TYPE_UNKNOWN;
mAttributes.usage = AUDIO_USAGE_UNKNOWN;
mAttributes.flags = 0x0;
strcpy(mAttributes.tags, "");
mAttributes = AUDIO_ATTRIBUTES_INITIALIZER;
(void)set(streamType, sampleRate, format, channelMask,
0 /*frameCount*/, flags, cbf, user, notificationFrames,

@ -305,8 +305,8 @@ static inline std::string toString(const audio_attributes_t& attributes)
result << "{ Content type: " << toString(attributes.content_type)
<< " Usage: " << toString(attributes.usage)
<< " Source: " << toString(attributes.source)
<< " Flags: " << attributes.flags
<< " Tags: " << attributes.tags
<< std::hex << " Flags: 0x" << attributes.flags
<< std::dec << " Tags: " << attributes.tags
<< " }";
return result.str();

Loading…
Cancel
Save