#720,解决,手表默认通话音量过小,手表是恢复出厂设置后查看的bug
authorluozheng <1732036298@qq.com>
Wed, 18 Sep 2024 10:30:39 +0000 (18:30 +0800)
committerluozheng <1732036298@qq.com>
Wed, 18 Sep 2024 10:30:39 +0000 (18:30 +0800)
code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp

index 54ce0a4..834f284 100644 (file)
@@ -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);