TWS: update active device volume
During race condition if inactive device volume
is register first than update active device volume
to remote. Active device volume is already updated
to audio during setActiveDevice function call.
Change-Id: I52c5c3489d6ab6dfba190ccef767d8ac62425c71
diff --git a/packages_apps_bluetooth_ext/src/avrcp/Avrcp_ext.java b/packages_apps_bluetooth_ext/src/avrcp/Avrcp_ext.java
index 923ad45..49623c0 100644
--- a/packages_apps_bluetooth_ext/src/avrcp/Avrcp_ext.java
+++ b/packages_apps_bluetooth_ext/src/avrcp/Avrcp_ext.java
@@ -1198,6 +1198,7 @@
}
if (msg.arg2 == AVRC_RSP_INTERIM && areMultipleDevicesConnected() &&
+ !(activeDevice != null && Objects.equals(deviceFeatures[deviceIndex].mCurrentDevice, activeDevice)) &&
deviceFeatures[deviceIndex].mInitialRemoteVolume == -1 &&
deviceFeatures[deviceIndex].mCurrentDevice.isTwsPlusDevice()) {
device = deviceFeatures[deviceIndex].mCurrentDevice;