From: cheng Date: Tue, 6 Aug 2024 10:23:25 +0000 (+0800) Subject: 优化勿扰场景 X-Git-Tag: release_V1.2.70_20241020_135402~694^2~1 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=317b0340e0fd76400456fb22cfb06279e85c4f5f;p=mirrors%2FFD230.git 优化勿扰场景 --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/alarm/src/AlarmClockModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/alarm/src/AlarmClockModel.cpp index 1dd336c76..ea88e66f6 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/alarm/src/AlarmClockModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/alarm/src/AlarmClockModel.cpp @@ -18,6 +18,7 @@ #include "PlayersModel.h" #include "PhoneService.h" #include "ui_service.h" +#include "../../../../../../../drivers/peripheral/config/include/ConfigModel.h" #ifdef __cplusplus extern "C" { @@ -691,8 +692,12 @@ void AlarmClockModel::PopInterPlayMusic() { int32_t timeout = -1; SendMsgToUIService(SCREEN_TURN_ON_TO_UI, 0, &timeout, sizeof(int32_t)); - GraphicService::GetInstance()->PostGraphicEvent( - std::bind(&AlarmClockModel::AlarmPlayerStart, AlarmClockModel::GetInstance())); + + if(true != ConfigModel::GetInstance()->GetDnotdisturb()) + { + GraphicService::GetInstance()->PostGraphicEvent( + std::bind(&AlarmClockModel::AlarmPlayerStart, AlarmClockModel::GetInstance())); + } } void AlarmClockModel::SetSliceId() diff --git a/code/sdk/application/wearable/fd230app/nativeui/countdown/src/CountDownModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/countdown/src/CountDownModel.cpp index a0d89394b..b93a47fc0 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/countdown/src/CountDownModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/countdown/src/CountDownModel.cpp @@ -12,6 +12,8 @@ #include "wearable_log.h" #include "countdown/include/MainCountDownView.h" #include +#include "../../../../../../../drivers/peripheral/config/include/ConfigModel.h" + namespace OHOS { /* -------------------------------------------------------------------------- */ @@ -306,7 +308,10 @@ namespace OHOS /*触发铃声的开始*/ void CountDownModel::RequestStartRingtone(void) { - PostRingtoneEvent(&CountDownModel::StartRingtonePlayback); + if(true != ConfigModel::GetInstance()->GetDnotdisturb()) + { + PostRingtoneEvent(&CountDownModel::StartRingtonePlayback); + } } /*触发铃声的停止*/ diff --git a/code/sdk/application/wearable/fd230app/nativeui/heart_blood/CheckInvalidView.cpp b/code/sdk/application/wearable/fd230app/nativeui/heart_blood/CheckInvalidView.cpp index a0a6bd970..fc845ebff 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/heart_blood/CheckInvalidView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/heart_blood/CheckInvalidView.cpp @@ -216,7 +216,10 @@ namespace OHOS } SetViewData(); - custom_VibratorFunc(VibratorType::VIBRATOR_TYPE_TWO); // 震动提醒 + if(true != OHOS::ConfigModel::GetInstance()->GetDnotdisturb()) + { + custom_VibratorFunc(VibratorType::VIBRATOR_TYPE_TWO); // 震动提醒 + } RootView::GetInstance()->Add(container_); SetContainerView(container_); diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingModel.cpp index d854077d1..f4e80afc2 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingModel.cpp @@ -457,7 +457,10 @@ namespace OHOS if (sportdata->heart >= maxHeartRate) { uapi_set_screen_on_api(); // 亮屏检测 - custom_VibratorFunc(VibratorType::VIBRATOR_TYPE_TWO); // 震动提醒 + if(true != OHOS::ConfigModel::GetInstance()->GetDnotdisturb()) + { + custom_VibratorFunc(VibratorType::VIBRATOR_TYPE_TWO); // 震动提醒 + } TraingCardView::GetInstance()->SetPopupViewStatus(HeartPopup, true); } @@ -471,7 +474,10 @@ namespace OHOS { // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "currentdata%d", currentdata); uapi_set_screen_on_api(); // 亮屏检测 - custom_VibratorFunc(VibratorType::VIBRATOR_TYPE_TWO); + if(true != OHOS::ConfigModel::GetInstance()->GetDnotdisturb()) + { + custom_VibratorFunc(VibratorType::VIBRATOR_TYPE_TWO); + } TraingCardView::GetInstance()->SetPopupViewStatus(GetTagPopup, true); TraingCardView::GetInstance()->GetAnimator()->Start(); Gettagstuats = true; 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 1f8eca030..90b0d60dd 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 @@ -701,7 +701,10 @@ void MsgCenterNotifySleepProc(const Topic topic, Request* req) if(SleepModel::GetInstance().get_sleep_state()==SLEEPSTATE::WAKE) { NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO); - AlarmClockModel::GetInstance()->PopInterPlayMusic(); + if(true != ConfigModel::GetInstance()->GetDnotdisturb()) + { + AlarmClockModel::GetInstance()->PopInterPlayMusic(); + } } else { @@ -731,7 +734,10 @@ void MsgCenterNotifyCatIncomingCallProc(const Topic topic, Request* req) } display_api->set_screen_set_keepon_timeout(10); - AlarmClockModel::GetInstance()->AlarmPlayerStart(); + if(true != ConfigModel::GetInstance()->GetDnotdisturb()) + { + AlarmClockModel::GetInstance()->AlarmPlayerStart(); + } CallerLogModel::GetInstance()->SetoperateNumber(call_data,req->len); CallerLogModel::GetInstance()->SetCallSource(CallerLogModel::CallSource::CallSourceCat1); diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/drinkReminder_notification.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/drinkReminder_notification.cpp index b07167d45..5ce3ae99c 100644 --- a/code/sdk/application/wearable/service/msg_center/src/notify/drinkReminder_notification.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/drinkReminder_notification.cpp @@ -89,7 +89,10 @@ namespace OHOS { /*亮屏加震动*/ uapi_set_screen_on_api(); - uapi_vibrationModeSet(ConfigModel::GetInstance()->GetVibrationReminder()); + if(true != ConfigModel::GetInstance()->GetDnotdisturb()) + { + uapi_vibrationModeSet(ConfigModel::GetInstance()->GetVibrationReminder()); + } } /*创建喝水提醒视图*/ diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/message_notification.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/message_notification.cpp index 868a62cf3..dafc878f4 100644 --- a/code/sdk/application/wearable/service/msg_center/src/notify/message_notification.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/message_notification.cpp @@ -14,6 +14,7 @@ #include "string" #include "vibrator_service.h" extern "C" void custom_VibratorFunc(OHOS::VibratorType vibratorType); +#include "../../../../../../../drivers/peripheral/config/include/ConfigModel.h" namespace OHOS { @@ -198,8 +199,12 @@ namespace OHOS MessageGroupView->Add(messageLabel); MessageGroupView->Add(deleteButton); - // 震动提醒 - custom_VibratorFunc(VibratorType::VIBRATOR_TYPE_TWO); + if(true != OHOS::ConfigModel::GetInstance()->GetDnotdisturb()) + { + // 震动提醒 + custom_VibratorFunc(VibratorType::VIBRATOR_TYPE_TWO); + } + int32_t timeout = 2000; // 亮屏操作 2000ms 2秒关闭 SendMsgToUIService(SCREEN_TURN_ON_TO_UI, 0, &timeout, sizeof(int32_t)); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Create MessageGroupView succeed!!"); diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/sleep_notification.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/sleep_notification.cpp index 4caa98e1b..adf52470e 100644 --- a/code/sdk/application/wearable/service/msg_center/src/notify/sleep_notification.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/sleep_notification.cpp @@ -146,7 +146,11 @@ namespace OHOS SleepGroupView->Add(sleepbutton); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Create SleepGroupView succeed!!"); - custom_VibratorFunc(VibratorType::VIBRATOR_TYPE_TWO); // 震动提醒 + + if(true != OHOS::ConfigModel::GetInstance()->GetDnotdisturb()) + { + custom_VibratorFunc(VibratorType::VIBRATOR_TYPE_TWO); // 震动提醒 + } int32_t timeout = 5000; // 亮屏操作 5000ms 5秒关闭 SendMsgToUIService(SCREEN_TURN_ON_TO_UI, 0, &timeout, sizeof(int32_t)); @@ -188,7 +192,10 @@ namespace OHOS SleepGroupView->Add(closebutton); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Create SleepGroupView succeed!!"); - custom_VibratorFunc(VibratorType::VIBRATOR_TYPE_TWO); // 震动提醒 + if(true != OHOS::ConfigModel::GetInstance()->GetDnotdisturb()) + { + custom_VibratorFunc(VibratorType::VIBRATOR_TYPE_TWO); // 震动提醒 + } } /*释放消息弹窗视图*/ void FreeSleepView(void)