From: luozheng <1732036298@qq.com> Date: Sat, 14 Sep 2024 11:14:29 +0000 (+0800) Subject: 解决静音模式错误开启后会全局静音bug,根据禅道期望“来电铃声、短信消息提醒,勿扰睡眠静音模式下只有亮屏提醒” X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=9398b30f94baea29ee1601942ae97b7a864f1041;p=mirrors%2FFD230.git 解决静音模式错误开启后会全局静音bug,根据禅道期望“来电铃声、短信消息提醒,勿扰睡眠静音模式下只有亮屏提醒” --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/include/SoundAndVibrationVolumeSettingC.h b/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/include/SoundAndVibrationVolumeSettingC.h index ecb05a39d..18042a462 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/include/SoundAndVibrationVolumeSettingC.h +++ b/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/include/SoundAndVibrationVolumeSettingC.h @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-04-19 18:59:49 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-09-06 14:43:29 + * @LastEditTime: 2024-09-14 18:28:53 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/include/SoundAndVibrationVolumeSettingC.h */ #ifndef SOUND_AND_VIBRATION_VOLUME_SETTINGC_H @@ -22,7 +22,6 @@ extern "C" void CallVolumeSet(int32_t sounding); int CallVolumeGet(void); // void VibationModeSet(int value); - void SilentModelSet(bool isopen); #ifdef __cplusplus #if __cplusplus } diff --git a/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SoundAndVibrationPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SoundAndVibrationPresenter.cpp index 159ab1222..29bcc4f4d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SoundAndVibrationPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SoundAndVibrationPresenter.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-02-19 10:39:11 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-07-16 17:04:06 + * @LastEditTime: 2024-09-14 18:28:58 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SoundAndVibrationPresenter.cpp */ @@ -152,12 +152,10 @@ namespace OHOS { case UICheckBox::SELECTED: WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SilentMode is enable!"); - SilentModelSet(true); p_SoundAndVibrationModel->SetSilentModeToggleButtonStatus(true); break; case UICheckBox::UNSELECTED: WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SilentMode is disable!"); - SilentModelSet(false); p_SoundAndVibrationModel->SetSilentModeToggleButtonStatus(false); break; default: 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 8b6e66162..eda49f13e 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-09-13 18:31:03 + * @LastEditTime: 2024-09-14 18:27:21 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SoundAndVibrationVolumeSettingPresenter.cpp */ #include "soundandvibration/include/SoundAndVibrationVolumeSettingPresenter.h" @@ -241,13 +241,6 @@ extern "C" return GetCallCurrVolume(); } - /* - * @brief 静音模式设置 - */ - void SilentModelSet(bool isopen) - { - AudioServiceSetMasterMute(isopen); - } #ifdef __cplusplus #if __cplusplus } diff --git a/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp b/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp index d62fd87ec..965b740a6 100644 --- a/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp +++ b/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp @@ -1869,7 +1869,6 @@ void set_SilentMode(uint8_t falg)//设置静音模式 { OHOS::ConfigModel *p_ConfigModel = OHOS::ConfigModel::GetInstance(); p_ConfigModel->SetSilentMode(falg); - uapi_setSilentMode(falg); #ifdef FD230 SendMsgToUIService(UI_UPDATE_SILENT_MODE,0,nullptr,0); #endif diff --git a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp index 4ee3333bb..0e4f5118e 100644 --- a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp @@ -854,7 +854,7 @@ void MsgCenterNotifyCatIncomingCallProc(const Topic topic, Request* req) { display_api->turn_on_screen(); } - if(true != ConfigModel::GetInstance()->GetDnotdisturb() && (!uapi_sleep_mode_flag_get())) + if(true != ConfigModel::GetInstance()->GetDnotdisturb() && (!uapi_sleep_mode_flag_get()) && true != ConfigModel::GetInstance()->GetSilentMode()) { AlarmClockModel::GetInstance()->testPlayerStart("/music/ring/ring.mp3"); } diff --git a/code/sdk/drivers/peripheral/config/src/ConfigModel.cpp b/code/sdk/drivers/peripheral/config/src/ConfigModel.cpp index f1eeac91e..34dd6ab03 100644 --- a/code/sdk/drivers/peripheral/config/src/ConfigModel.cpp +++ b/code/sdk/drivers/peripheral/config/src/ConfigModel.cpp @@ -1052,7 +1052,6 @@ namespace OHOS void ConfigModel::SetSilentMode(bool state) { set_condigData_Bool(CONFIGMODEL_ITEM_SILENT_MODE,state); - //uapi_setSilentMode(state); } /*获取静音模式是否开启*/ @@ -1370,7 +1369,6 @@ void cm_initializeSilentModel(void) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "cm_initializeSilentModel"); bool isopen = OHOS::ConfigModel::GetInstance()->GetSilentMode(); - uapi_setSilentMode(isopen); } void cm_initializeVoLTECall(void) diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.c b/code/sdk/drivers/peripheral/utils/custom_utils.c index 697101f58..75668456e 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.c +++ b/code/sdk/drivers/peripheral/utils/custom_utils.c @@ -1169,13 +1169,6 @@ int uapi_callVolumeGet(void) } -//设置是否静音 -void uapi_setSilentMode(bool isopen) -{ - #ifdef FD230 - SilentModelSet(isopen); - #endif -} void power_on_cat1(void) { uapi_cat1_power_on(1); diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.h b/code/sdk/drivers/peripheral/utils/custom_utils.h index eacc91c7b..768b4582f 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.h +++ b/code/sdk/drivers/peripheral/utils/custom_utils.h @@ -118,7 +118,6 @@ int uapi_systemVolumeGet(void); void uapi_callVolumeSet(int32_t sounding); int uapi_callVolumeGet(void); // void uapi_vibrationModeSet(int value); -void uapi_setSilentMode(bool isopen); void uapi_set4GCapability(bool isopen); errcode_t uapi_get_btaddr(uint8_t *buf_btaddr, uint32_t *len_btaddr);