From 1c91b62ea573082581e72fd433d02e3dc52dbf51 Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期一, 05 一月 2026 11:03:29 +0800
Subject: [PATCH] 2026年01月05日11:00:26 升级gradle和uni库

---
 app/src/main/java/com/hdl/photovoltaic/push/fcm/MyFirebaseMessagingService.java |   54 +++++++++++++++++++++++++++---------------------------
 1 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/app/src/main/java/com/hdl/photovoltaic/push/fcm/MyFirebaseMessagingService.java b/app/src/main/java/com/hdl/photovoltaic/push/fcm/MyFirebaseMessagingService.java
index 492b4cf..6b0565b 100644
--- a/app/src/main/java/com/hdl/photovoltaic/push/fcm/MyFirebaseMessagingService.java
+++ b/app/src/main/java/com/hdl/photovoltaic/push/fcm/MyFirebaseMessagingService.java
@@ -20,23 +20,16 @@
 import com.google.firebase.messaging.RemoteMessage;
 import com.hdl.photovoltaic.R;
 import com.hdl.photovoltaic.config.ConstantManage;
-import com.hdl.photovoltaic.config.UserConfigManage;
-import com.hdl.photovoltaic.enums.MessageStateType;
-import com.hdl.photovoltaic.other.HdlPushLogic;
+import com.hdl.photovoltaic.push.CustomNotification;
 import com.hdl.photovoltaic.push.PushMessageInfoBean;
-import com.hdl.photovoltaic.ui.BPowerStationActivity;
 import com.hdl.photovoltaic.ui.StartActivity;
-import com.hdl.photovoltaic.uni.HDLUniMPSDKManager;
 import com.hdl.sdk.link.core.bean.eventbus.BaseEventBus;
 
 import org.greenrobot.eventbus.EventBus;
 
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
 
-import cn.jpush.android.api.NotificationMessage;
+import java.util.List;
+
 
 /**
  * 璋锋瓕鎺ㄩ�佹秷鎭帴鏀舵柟娉�
@@ -59,7 +52,7 @@
      */
     @Override
     public void onMessageReceived(RemoteMessage remoteMessage) {
-        Log.d(TAG, "鍦ㄥ墠鍙拌繕鏄湪鍚�" + isAppInForeground(this));
+        Log.d(TAG, "鏄惁鍦ㄥ墠鍙帮細" + isAppInForeground(this));
         Log.d(TAG, "鏉ヨ嚜RemoteMessage: " + JSON.toJSONString(remoteMessage));
 //        // 鏁版嵁娑堟伅锛氫换浣曠姸鎬侀兘浼氭墽琛�
 //        if (!remoteMessage.getData().isEmpty()) {
@@ -70,27 +63,32 @@
 //        if (remoteMessage.getNotification() != null) {
 //            handleNotification(remoteMessage.getNotification()); // 鍙湁鍓嶅彴鎵ц
 //        }
+
+
         String title = "";//鎺ㄩ�佹爣棰�
         String content = "";//鎺ㄩ�佸唴瀹�
         if (remoteMessage.getNotification() != null) {
             title = remoteMessage.getNotification().getTitle();
             content = remoteMessage.getNotification().getBody();
         }
-        //鍘熺敓鍦ㄥ墠鍙版垨鑰卽ni鍦ㄥ墠鍙�
-        if (isAppInForeground(this) || HDLUniMPSDKManager.getInstance().showUniMP()) {
-            // 妫�鏌ユ秷鎭槸鍚﹀寘鍚暟鎹礋杞�
-            if (!remoteMessage.getData().isEmpty()) {
-                PushMessageInfoBean pushMessageInfoBean = HdlPushLogic.getInstance().pushDataProcessing(title, content, JSON.toJSONString(remoteMessage.getData()));
-                HdlPushLogic.getInstance().PushPushCommonData(this, pushMessageInfoBean, false);
-//            this.showCustomNotification(pushMessageInfoBean);
-            }
-        } else {
-            // 妫�鏌ユ秷鎭槸鍚﹀寘鍚�氱煡璐熻浇
-            if (!remoteMessage.getData().isEmpty()) {
-                PushMessageInfoBean pushMessageInfoBean = HdlPushLogic.getInstance().pushDataProcessing(title, content, JSON.toJSONString(remoteMessage.getData()));
-                this.showCustomNotification(pushMessageInfoBean);
-            }
+        if (!remoteMessage.getData().isEmpty()) {
+            CustomNotification.getInstance().messageDataProcessing(this, title, content, JSON.toJSONString(remoteMessage.getData()), CustomNotification.FromPush.FCM);
         }
+//        //鍘熺敓鍦ㄥ墠鍙版垨鑰卽ni鍦ㄥ墠鍙�
+//        if (isAppInForeground(this)) {
+//            // 妫�鏌ユ秷鎭槸鍚﹀寘鍚暟鎹礋杞�
+//            if (!remoteMessage.getData().isEmpty()) {
+//                PushMessageInfoBean pushMessageInfoBean = HdlPushLogic.getInstance().pushDataProcessing(title, content, JSON.toJSONString(remoteMessage.getData()));
+//                HdlPushLogic.getInstance().PushPushCommonData(this, pushMessageInfoBean, false);
+////            this.showCustomNotification(pushMessageInfoBean);
+//            }
+//        } else {
+//            // 妫�鏌ユ秷鎭槸鍚﹀寘鍚�氱煡璐熻浇
+//            if (!remoteMessage.getData().isEmpty()) {
+//                PushMessageInfoBean pushMessageInfoBean = HdlPushLogic.getInstance().pushDataProcessing(title, content, JSON.toJSONString(remoteMessage.getData()));
+//                this.showCustomNotification(pushMessageInfoBean);
+//            }
+//        }
     }
 
 
@@ -178,9 +176,11 @@
                 return false;
             }
             final String packageName = context.getPackageName();
+            final String uniPackageName = packageName + ":unimp0";
             for (ActivityManager.RunningAppProcessInfo appProcess : appProcesses) {
-                if (appProcess.importance == ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND &&
-                        appProcess.processName.equals(packageName)) {
+                if ((appProcess.importance == ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND &&
+                        appProcess.processName.equals(packageName)) || (appProcess.importance == ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND &&
+                        appProcess.processName.equals(uniPackageName))) {
                     return true;
                 }
             }

--
Gitblit v1.8.0