Loading android/app/src/com/android/bluetooth/vc/VolumeControlService.java +20 −12 Original line number Diff line number Diff line Loading @@ -1366,10 +1366,12 @@ public class VolumeControlService extends ProfileService { } else if (toState == BluetoothProfile.STATE_CONNECTED) { // Restore the group volume if it was changed while the device was not yet connected. CsipSetCoordinatorService csipClient = mFactory.getCsipSetCoordinatorService(); if (csipClient != null) { Integer groupId = csipClient.getGroupId(device, BluetoothUuid.CAP); if (groupId != IBluetoothCsipSetCoordinator.CSIS_GROUP_ID_INVALID) { Integer groupVolume = mGroupVolumeCache.getOrDefault(groupId, IBluetoothVolumeControl.VOLUME_CONTROL_UNKNOWN_VOLUME); Integer groupVolume = mGroupVolumeCache.getOrDefault( groupId, IBluetoothVolumeControl.VOLUME_CONTROL_UNKNOWN_VOLUME); if (groupVolume != IBluetoothVolumeControl.VOLUME_CONTROL_UNKNOWN_VOLUME) { mVolumeControlNativeInterface.setVolume(device, groupVolume); } Loading @@ -1381,6 +1383,12 @@ public class VolumeControlService extends ProfileService { mVolumeControlNativeInterface.unmute(device); } } } else { /* It could happen when Bluetooth is stopping while VC is getting * connection event */ Log.w(TAG, "CSIP is not available"); } } mAdapterService.handleProfileConnectionStateChange( BluetoothProfile.VOLUME_CONTROL, device, fromState, toState); Loading Loading
android/app/src/com/android/bluetooth/vc/VolumeControlService.java +20 −12 Original line number Diff line number Diff line Loading @@ -1366,10 +1366,12 @@ public class VolumeControlService extends ProfileService { } else if (toState == BluetoothProfile.STATE_CONNECTED) { // Restore the group volume if it was changed while the device was not yet connected. CsipSetCoordinatorService csipClient = mFactory.getCsipSetCoordinatorService(); if (csipClient != null) { Integer groupId = csipClient.getGroupId(device, BluetoothUuid.CAP); if (groupId != IBluetoothCsipSetCoordinator.CSIS_GROUP_ID_INVALID) { Integer groupVolume = mGroupVolumeCache.getOrDefault(groupId, IBluetoothVolumeControl.VOLUME_CONTROL_UNKNOWN_VOLUME); Integer groupVolume = mGroupVolumeCache.getOrDefault( groupId, IBluetoothVolumeControl.VOLUME_CONTROL_UNKNOWN_VOLUME); if (groupVolume != IBluetoothVolumeControl.VOLUME_CONTROL_UNKNOWN_VOLUME) { mVolumeControlNativeInterface.setVolume(device, groupVolume); } Loading @@ -1381,6 +1383,12 @@ public class VolumeControlService extends ProfileService { mVolumeControlNativeInterface.unmute(device); } } } else { /* It could happen when Bluetooth is stopping while VC is getting * connection event */ Log.w(TAG, "CSIP is not available"); } } mAdapterService.handleProfileConnectionStateChange( BluetoothProfile.VOLUME_CONTROL, device, fromState, toState); Loading