Audio policy: fix failure to unmute strategy.

When setOutputDevices() is called with a device not supported by the
output profile, checkDeviceMuteStrategies() was not called.
If a strategy was muted by this output because of a previous
device combination, it will never be unmuted.
A typical repro scenario is:
1) music plays over A2DP via offload path
2) incoming call: ringtone plays over speaker + A2DP
   => music is paused by audio focus
3) music manually resumed
   => media strategy is muted because it cannot play over
a2dp + speaker
4) call answered and routed to earpiece
   a) offload output is routed to earpiece which is not
supported by offload output profile
   => we fail to unmute media
   b) music stream is invalidated because earpiece is
   not supported by offload output
   => offload output is closed and we will never unmute media strategy

Fixed by calling checkDeviceMuteStrategies() before exiting in
case of unsupported device.

Bug: 157344812
Test: repro steps in bug
Test: audio regression tests
Change-Id: I0c1c189c038803a584dc222aee50c3a99c572263
1 file changed