From: hcj <1224667075@qq.com> Date: Wed, 31 Jul 2024 01:54:01 +0000 (+0800) Subject: 增加充电状态改变判断弹窗是否存在再free,避免误free到其他弹窗 X-Git-Tag: release_V1.2.70_20241020_135402~555^2~24 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F617%2Fhead;p=mirrors%2FFD230.git 增加充电状态改变判断弹窗是否存在再free,避免误free到其他弹窗 --- diff --git a/code/sdk/application/wearable/service/msg_center/include/notify/charge_notification.h b/code/sdk/application/wearable/service/msg_center/include/notify/charge_notification.h index 58073b276..b37d65be5 100644 --- a/code/sdk/application/wearable/service/msg_center/include/notify/charge_notification.h +++ b/code/sdk/application/wearable/service/msg_center/include/notify/charge_notification.h @@ -7,6 +7,7 @@ namespace OHOS // UIViewGroup *ChargingStatuShow(void); // UIView *view_ = nullptr; void FreeChargePower(void); + bool is_UIViewGroup_charge(void); UIViewGroup * ShowChargeingView(void); UIViewGroup* lowPowerShow(void); 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 22c993415..16ed61dce 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 @@ -360,6 +360,7 @@ void MsgCenterNotifyChargePlugProc(const Topic topic, Request* req) } else { + NotificationManager::GetInstance()->ShowNotify(ShowChargeingNotify, (uint16_t)topic, true); } @@ -383,6 +384,7 @@ void MsgCenterNotifyChargeUnPlugProc(const Topic topic, Request* req) } else { + if(is_UIViewGroup_charge()) NotificationManager::GetInstance()->StopNotify(); } } diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/charge_notification.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/charge_notification.cpp index 313c3f3ff..11d0ca84b 100644 --- a/code/sdk/application/wearable/service/msg_center/src/notify/charge_notification.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/charge_notification.cpp @@ -77,6 +77,15 @@ namespace OHOS } + bool is_UIViewGroup_charge(void) + { + if(UIViewGroup_charge != nullptr) + { + return true; + } + return false; + } + void FreeChargePower(void) { if (UIViewGroup_charge != nullptr)