[AudioPolicy] fix volume regression

This CL fixes regression introduced in aosp/1213724

The regression happened when offloaded music is played, volume
is reduced, next song is requested then the volume is switching
to full scale.

It is linked to a "ghost volume source" without stream types that
is considered as a music stream before volume is set in AudioFlinger.
The music volume was overwritten by this volume source.

This CL fixes only the ghost volume source by preventing to add twice
the internal volumes sources linked to AUDIO_STREAM_PATCH and
AUDIO_STREAM_REROUTING.

The clean fix consists in aligning AudioFlinger on volume sources
rather than stream types.

Bug: 148588565
Test: plays offloaded music, reduce volume to min.
      Then press next song.
      No volume gap expected.

Change-Id: I0bb3b5ca1f13ba23351bcd658acf8d7f52555929
Merged-In: I0bb3b5ca1f13ba23351bcd658acf8d7f52555929
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
1 file changed