From c14924cc6baa0c68f38f60ac0ccb7f8613e3fb41 Mon Sep 17 00:00:00 2001 From: hcj <1224667075@qq.com> Date: Wed, 31 Jul 2024 09:54:01 +0800 Subject: [PATCH] =?utf8?q?=E5=A2=9E=E5=8A=A0=E5=85=85=E7=94=B5=E7=8A=B6?= =?utf8?q?=E6=80=81=E6=94=B9=E5=8F=98=E5=88=A4=E6=96=AD=E5=BC=B9=E7=AA=97?= =?utf8?q?=E6=98=AF=E5=90=A6=E5=AD=98=E5=9C=A8=E5=86=8Dfree=EF=BC=8C?= =?utf8?q?=E9=81=BF=E5=85=8D=E8=AF=AFfree=E5=88=B0=E5=85=B6=E4=BB=96?= =?utf8?q?=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../msg_center/include/notify/charge_notification.h | 1 + .../service/msg_center/src/msg_center_customer.cpp | 2 ++ .../msg_center/src/notify/charge_notification.cpp | 9 +++++++++ 3 files changed, 12 insertions(+) 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) -- 2.17.1