mirror of
https://gitee.com/openharmony/multimedia_audio_standard
synced 2024-11-23 12:49:50 +00:00
!614 [Revert] GetVolume changes and adapt to new changes
Merge pull request !614 from AshishSawakar/revert_change
This commit is contained in:
commit
f593be7f76
@ -234,9 +234,6 @@ int32_t AudioPolicyServer::SetStreamVolume(AudioStreamType streamType, float vol
|
||||
|
||||
float AudioPolicyServer::GetStreamVolume(AudioStreamType streamType)
|
||||
{
|
||||
if (GetStreamMute(streamType)) {
|
||||
return MIN_VOLUME_LEVEL;
|
||||
}
|
||||
return mPolicyService.GetStreamVolume(streamType);
|
||||
}
|
||||
|
||||
@ -249,18 +246,7 @@ int32_t AudioPolicyServer::SetStreamMute(AudioStreamType streamType, bool mute)
|
||||
}
|
||||
}
|
||||
|
||||
int result = mPolicyService.SetStreamMute(streamType, mute);
|
||||
for (auto it = volumeChangeCbsMap_.begin(); it != volumeChangeCbsMap_.end(); ++it) {
|
||||
std::shared_ptr<VolumeKeyEventCallback> volumeChangeCb = it->second;
|
||||
if (volumeChangeCb == nullptr) {
|
||||
AUDIO_ERR_LOG("volumeChangeCb: nullptr for client : %{public}d", it->first);
|
||||
continue;
|
||||
}
|
||||
AUDIO_DEBUG_LOG("AudioPolicyServer::SetStreamMute trigger volumeChangeCb clientPid : %{public}d", it->first);
|
||||
volumeChangeCb->OnVolumeKeyEvent(streamType, ConvertVolumeToInt(GetStreamVolume(streamType)), false);
|
||||
}
|
||||
|
||||
return result;
|
||||
return mPolicyService.SetStreamMute(streamType, mute);
|
||||
}
|
||||
|
||||
int32_t AudioPolicyServer::SetStreamVolume(AudioStreamType streamType, float volume, bool isUpdateUi)
|
||||
|
Loading…
Reference in New Issue
Block a user