aaudio: ignore device updates for UNSPECIFIED

We can get a device change to UNSPECIFIED sometimes
when using a duplicate device.
This can happen when using the Legacy USB HAL and
Usage ALARM or RINGTONE.
It makes no sense so we log an error and ignore it.

Bug: 343006991
Test: see bug for repro steps
Test: atest AAudioTests
Flag: EXEMPT bugfix
Change-Id: I38d1ef0629917d5f0a944996706d6d3c65762171
diff --git a/media/libaaudio/src/legacy/AudioStreamLegacy.cpp b/media/libaaudio/src/legacy/AudioStreamLegacy.cpp
index 8595308..255bd0f 100644
--- a/media/libaaudio/src/legacy/AudioStreamLegacy.cpp
+++ b/media/libaaudio/src/legacy/AudioStreamLegacy.cpp
@@ -261,6 +261,11 @@
 
 void AudioStreamLegacy::onAudioDeviceUpdate(audio_io_handle_t /* audioIo */,
             audio_port_handle_t deviceId) {
+    // Check for an invalid deviceId. Why change to UNSPECIFIED?
+    if (deviceId == AAUDIO_UNSPECIFIED) {
+        ALOGE("%s(, deviceId = AAUDIO_UNSPECIFIED)! Why?", __func__);
+        return;
+    }
     // Device routing is a common source of errors and DISCONNECTS.
     // Please leave this log in place. If there is a bug then this might
     // get called after the stream has been deleted so log before we