From: luozheng <1732036298@qq.com> Date: Mon, 16 Dec 2024 09:32:51 +0000 (+0800) Subject: 优化系统音量控制:查找手表,闹钟铃声,倒计时,的声音现在受系统音量控制 X-Git-Tag: v1.3.113-repair_tp~143^2~2 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F1522%2Fhead;p=mirrors%2FFD230.git 优化系统音量控制:查找手表,闹钟铃声,倒计时,的声音现在受系统音量控制 --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SoundAndVibrationVolumeSettingPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SoundAndVibrationVolumeSettingPresenter.cpp index 42fd9536a..aec96c0c9 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SoundAndVibrationVolumeSettingPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SoundAndVibrationVolumeSettingPresenter.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-04-19 10:08:31 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-11-05 14:42:59 + * @LastEditTime: 2024-12-16 15:17:04 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SoundAndVibrationVolumeSettingPresenter.cpp */ #include "soundandvibration/include/SoundAndVibrationVolumeSettingPresenter.h" @@ -223,6 +223,7 @@ extern "C" { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemVolumeSet %d", sounding); Audio::AudioManager::GetInstance().SetVolume(AUDIO_STREAM_MUSIC, sounding); // 系统音量设置 + Audio::AudioManager::GetInstance().SetVolume(AUDIO_STREAM_NOTIFICATION_SYSTEM, sounding); // 查找手表,闹钟,倒计时铃声也受系统音量控制 } int SystemVolumeGet(void) diff --git a/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audiomanager/cpp/audio_manager.cpp b/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audiomanager/cpp/audio_manager.cpp index cc70e95c5..0b82ce8c9 100755 --- a/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audiomanager/cpp/audio_manager.cpp +++ b/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audiomanager/cpp/audio_manager.cpp @@ -45,7 +45,7 @@ bool AudioManager::SetVolume(AudioStreamType streamType, int32_t volume) CHK_NULL_RETURN(impl_, false, "impl_ is nullptr"); - if(streamType == AUDIO_STREAM_MUSIC || streamType == AUDIO_STREAM_A2DP_MUSIC) + if(streamType == AUDIO_STREAM_MUSIC || streamType == AUDIO_STREAM_A2DP_MUSIC || streamType == AUDIO_STREAM_NOTIFICATION_SYSTEM) { if(volume == 0) volume = 0;