Pal: Add check of device count to skip restoreDevice for plugin devices
If there is active stream running on current plugin device, no need
to check the re-configuration of device switch.
Add check of device count to skip restoreDevice for plugin devices.
Change-Id: I06174cc8385aae04a9894f8a6b123f767f586914
(cherry picked from commit b483ea2f3178b42faa589109fe46b1da2f526559)
diff --git a/resource_manager/src/ResourceManager.cpp b/resource_manager/src/ResourceManager.cpp
index 5cc45d5..4fea904 100644
--- a/resource_manager/src/ResourceManager.cpp
+++ b/resource_manager/src/ResourceManager.cpp
@@ -12092,8 +12092,8 @@
PAL_ERR(LOG_TAG, "invalid dev cannot restore device");
goto exit;
}
-
- if (isPluginPlaybackDevice((pal_device_id_t)dev->getSndDeviceId())) {
+ if (isPluginPlaybackDevice((pal_device_id_t)dev->getSndDeviceId()) &&
+ (dev->getDeviceCount() != 0)) {
PAL_ERR(LOG_TAG, "don't restore device for usb/3.5 hs playback");
goto exit;
}