audiopolicy: Close the voip output before track is invalidated

With 3rd party voip application, compress voip usecase is
failed to be selected by policy when headset is inserted during
voip call.
Audio policy invalidates the track first and then closes the
direct output. Voip output count is not reset to 0 when new track
is created from restoreTrack. APM rejects voip usecae due to
this reason.
Close voip output before invalidating the track to avoid this
issue.

CRs-Fixed: 2251583
Change-Id: I9fac1974fae2565daee10fce44f4a14d6961421b
1 file changed
tree: 56f6863af0361c863530440eb997b67788c3be80
  1. policy_hal/
  2. Android.mk