From: luozheng <1732036298@qq.com> Date: Wed, 18 Sep 2024 10:30:39 +0000 (+0800) Subject: #720,解决,手表默认通话音量过小,手表是恢复出厂设置后查看的bug X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=10a2f0e35f595f34798728ca1a3fbedaa2e1e9b7;p=mirrors%2FFD230.git #720,解决,手表默认通话音量过小,手表是恢复出厂设置后查看的bug --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp b/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp index 54ce0a475..834f284fa 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp @@ -1887,7 +1887,9 @@ unsigned char GetCallCurrVolume(void) int32_t volume = PhoneCAT1AudioGetVolume(); int32_t minVolume = PhoneAudioGetCAT1MinVolume(); int32_t maxVolume = PhoneAudioGetCAT1MAXVolume(); - unsigned char hfpVolume = (unsigned char)((volume * CALL_VOLUME_MAX) / (maxVolume - minVolume)); // 转换 + // unsigned char hfpVolume = (unsigned char)((volume * CALL_VOLUME_MAX) / (maxVolume - minVolume)); // 转换 + unsigned char hfpVolume = volume; + if (volume != 0 && hfpVolume == 0) { hfpVolume = 1; @@ -1901,7 +1903,8 @@ unsigned char GetCallCurrVolume(void) int32_t volume = PhoneAudioGetVolume(); int32_t minVolume = PhoneAudioGetMinVolume(); int32_t maxVolume = PhoneAudioGetMaxVolume(); - unsigned char hfpVolume = (unsigned char)((volume * CALL_VOLUME_MAX) / (maxVolume - minVolume)); // 转换 + // unsigned char hfpVolume = (unsigned char)((volume * CALL_VOLUME_MAX) / (maxVolume - minVolume)); // 转换 + unsigned char hfpVolume = volume; if (volume != 0 && hfpVolume == 0) { hfpVolume = 1; @@ -1967,7 +1970,8 @@ void set_speaker_volume(unsigned char hfpVolume,int type) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[SetSpeakerVolume] start, CallSourceCat1:%d", hfpVolume); int32_t minVolume = PhoneAudioGetCAT1MinVolume(); int32_t maxVolume = PhoneAudioGetCAT1MAXVolume(); - int32_t volume = hfpVolume * (maxVolume - minVolume)/ CALL_VOLUME_MAX;// 转换 + // int32_t volume = hfpVolume * (maxVolume - minVolume)/ CALL_VOLUME_MAX;// 转换 + int32_t volume = hfpVolume; WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[SetSpeakerVolume] minVolume:%d, maxVolume:%d, volume:%d", minVolume, maxVolume, volume); @@ -1983,7 +1987,8 @@ void set_speaker_volume(unsigned char hfpVolume,int type) WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[SetSpeakerVolume] start, hfpVolume:%d", hfpVolume); int32_t minVolume = PhoneAudioGetMinVolume(); int32_t maxVolume = PhoneAudioGetMaxVolume(); - int32_t volume = hfpVolume * (maxVolume - minVolume) / CALL_VOLUME_MAX; // 转换 + // int32_t volume = hfpVolume * (maxVolume - minVolume) / CALL_VOLUME_MAX; // 转换 + int32_t volume = hfpVolume; WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[SetSpeakerVolume] minVolume:%d, maxVolume:%d, volume:%d", minVolume, maxVolume, volume);