hal: audio: on routing command check first voice usecase
am: 0d3637a0b0

Change-Id: I47780b4965669e5e45c609c52fc24194ceeb77fc
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 77dfc7a..1a77278 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -1777,14 +1777,6 @@
             bool same_dev = out->devices == new_dev;
             out->devices = new_dev;
 
-            if (!out->standby) {
-                if (!same_dev) {
-                    ALOGV("update routing change");
-                    out->routing_change = true;
-                }
-                select_devices(adev, out->usecase);
-            }
-
             if (output_drives_call(adev, out)) {
                 if (!voice_is_in_call(adev)) {
                     if (adev->mode == AUDIO_MODE_IN_CALL) {
@@ -1796,6 +1788,15 @@
                     voice_update_devices_for_all_voice_usecases(adev);
                 }
             }
+
+            if (!out->standby) {
+                if (!same_dev) {
+                    ALOGV("update routing change");
+                    out->routing_change = true;
+                }
+                select_devices(adev, out->usecase);
+            }
+
         }
 
         pthread_mutex_unlock(&adev->lock);