hal: Ensure device_name is copied if empty

For an unknown reason, an msm8960 device name gets empty even
though the value is correct platform side. Fix this copying
again directly if it's empty.

We don't have to worry about checking if it's valid since a check
has been performed before regarding it's validity.
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 35b726e..46a18bf 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -558,7 +558,17 @@
             goto on_error;
         }
 
-        ALOGD("%s: snd_device(%d: %s)", __func__, snd_device, device_name);
+        /*
+         * For some unknown reason, the device name gets empty for
+         * msm8960 devices. Because we're sure that the sound device is valid,
+         * copy it manually and apply the correct route. 
+        */
+
+        if (strlen(device_name) == 0) {
+            strcpy(device_name, platform_get_snd_device_name(snd_device));
+        }
+
+        ALOGV("%s: snd_device(%d: %s)", __func__, snd_device, device_name);
         audio_route_apply_and_update_path(adev->audio_route, device_name);
     }
 on_success:
@@ -602,7 +612,15 @@
                 return -EINVAL;
             }
 
-            ALOGD("%s: snd_device(%d: %s)", __func__, snd_device, device_name);
+            /*
+             * Same reason as in enable_snd_device()
+             */
+
+            if (strlen(device_name) == 0) {
+                strcpy(device_name, platform_get_snd_device_name(snd_device));
+            }
+
+            ALOGV("%s: snd_device(%d: %s)", __func__, snd_device, device_name);
             audio_route_reset_and_update_path(adev->audio_route, device_name);
         }
         audio_extn_sound_trigger_update_device_status(snd_device,