diff --git a/services/audio_policy/server/src/service/audio_policy_service.cpp b/services/audio_policy/server/src/service/audio_policy_service.cpp index eff6ea254048b258beda4502148e1aff0ed8bf7e..a0002e262e8541bead4b7492dd392e469d1d09ff 100644 --- a/services/audio_policy/server/src/service/audio_policy_service.cpp +++ b/services/audio_policy/server/src/service/audio_policy_service.cpp @@ -235,7 +235,7 @@ int32_t AudioPolicyService::SetSystemVolumeLevel(AudioStreamType streamType, int int32_t result = SUCCESS; // if current active device's type is DEVICE_TYPE_BLUETOOTH_A2DP and it support absolute volume, set // its absolute volume value. - if (currentActiveDevice_.deviceType_ == DEVICE_TYPE_BLUETOOTH_A2DP) { + if (streamType == STREAM_MUSIC && currentActiveDevice_.deviceType_ == DEVICE_TYPE_BLUETOOTH_A2DP) { result = SetA2dpDeviceVolume(activeBTDevice_, volumeLevel); if (result == SUCCESS) { // set to avrcp device @@ -318,7 +318,7 @@ int32_t AudioPolicyService::GetSystemVolumeLevel(AudioStreamType streamType, boo // if current active device's type is DEVICE_TYPE_BLUETOOTH_A2DP and it support absolute volume, get // its absolute volume value. std::lock_guard lock(a2dpDeviceMapMutex_); - if (currentActiveDevice_.deviceType_ == DEVICE_TYPE_BLUETOOTH_A2DP) { + if (streamType == STREAM_MUSIC && currentActiveDevice_.deviceType_ == DEVICE_TYPE_BLUETOOTH_A2DP) { auto configInfoPos = connectedA2dpDeviceMap_.find(activeBTDevice_); if (configInfoPos != connectedA2dpDeviceMap_.end() && configInfoPos->second.absVolumeSupport) {