audio policy: fix call volume upon speaker to USB transition

Fix voice volume handling in checkAndSetVolume() to only update
voice volume when changing volume on the primary output.
By convention, call routing and volume is managed by the primary output
and as other outputs may use a different device than the device selected
for calls, a wrong voice volume can be computed and overwrite a correct
volume set previously.

Bug: 195907034
Test: repro steps in the bug
Change-Id: Iafecb4df159db84addc3d802cdd2775cc696e07e
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
index cc2d8e8..cb9d700 100644
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
@@ -6548,7 +6548,7 @@
     outputDesc->setVolume(
             volumeDb, volumeSource, curves.getStreamTypes(), deviceTypes, delayMs, force);
 
-    if (isVoiceVolSrc || isBtScoVolSrc) {
+    if (outputDesc == mPrimaryOutput && (isVoiceVolSrc || isBtScoVolSrc)) {
         float voiceVolume;
         // Force voice volume to max or mute for Bluetooth SCO as other attenuations are managed by the headset
         if (isVoiceVolSrc) {