增加充电状态改变判断弹窗是否存在再free,避免误free到其他弹窗 617/1 617/head 618/target/1
authorhcj <1224667075@qq.com>
Wed, 31 Jul 2024 01:54:01 +0000 (09:54 +0800)
committerhcj <1224667075@qq.com>
Wed, 31 Jul 2024 01:54:01 +0000 (09:54 +0800)
code/sdk/application/wearable/service/msg_center/include/notify/charge_notification.h
code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp
code/sdk/application/wearable/service/msg_center/src/notify/charge_notification.cpp

index 58073b2..b37d65b 100644 (file)
@@ -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);
index 22c9934..16ed61d 100644 (file)
@@ -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();
     }
 }
index 313c3f3..11d0ca8 100644 (file)
@@ -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)