From 3ec7de773bff5582411c6f1f659d35cf8fb1734a Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期二, 16 七月 2024 15:13:51 +0800
Subject: [PATCH] Merge branch 'feature/v1.4.1'

---
 app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMPSDKManager.java |   27 ++++++++++++++++-----------
 1 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMPSDKManager.java b/app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMPSDKManager.java
index 6f5b2e7..4e17ed0 100644
--- a/app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMPSDKManager.java
+++ b/app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMPSDKManager.java
@@ -3,13 +3,16 @@
 import android.app.Application;
 import android.content.Context;
 import android.os.Environment;
+import android.os.SystemClock;
 import android.text.TextUtils;
 
 
 import com.google.gson.Gson;
+import com.hdl.linkpm.sdk.user.HDLLinkPMUser;
 import com.hdl.photovoltaic.HDLApp;
 import com.hdl.photovoltaic.R;
 import com.hdl.photovoltaic.config.AppConfigManage;
+import com.hdl.photovoltaic.enums.LowerTagType;
 import com.hdl.photovoltaic.other.HdlLogLogic;
 import com.hdl.photovoltaic.other.HdlThreadLogic;
 import com.hdl.sdk.link.core.bean.eventbus.BaseEventBus;
@@ -118,7 +121,8 @@
 
                 //灏忕▼搴忚鍏抽棴浜嗛�氱煡缁欏師鐢�
                 BaseEventBus baseEventBus = new BaseEventBus();
-                baseEventBus.setType(HDLUniMP.UNI_EVENT_REPLY_HOME_CLOSE_HOME_DETAILS_PAGE);
+                baseEventBus.setTopic(HDLUniMP.UNI_EVENT_REPLY_HOME_CLOSE_HOME_DETAILS_PAGE);
+                baseEventBus.setType(LowerTagType.power_station.toString());
                 EventBus.getDefault().post(baseEventBus);
 
             }
@@ -155,6 +159,8 @@
                     if (onOtherUniMPEventCallBack != null) {
                         onOtherUniMPEventCallBack.onOtherUniMPEventReceive(appid, event, data, callback);
                     } else {
+                        //鏈夊彲鑳芥槸绯荤粺鍥炴敹鎺塧ctivity鍒扮煡閬撳洖璋冧负null锛岃繖鏍锋儏鍐典笅寮哄埗杩斿洖鐧诲綍鐣岄潰锛�
+                        HDLLinkPMUser.getInstance().logout(0);
                         HdlLogLogic.print("鏀跺埌灏忕▼搴忛�氱煡,鍥炶皟浜嬩欢涓簄ull,鏃犳硶鍥炶皟浜嬩欢骞舵墽琛屼笟鍔¢�昏緫--->event=" + event + "\r\n" + "data=" + data, true);
                     }
                 }
@@ -255,15 +261,6 @@
         return true;
     }
 
-    /**
-     * 鎵撳紑灏忕▼搴�
-     *
-     * @param uniAppId   灏忕▼搴廔D
-     * @param path       鎸囧畾璺緞
-     *                   渚嬶細pages/component/scroll-view/scroll-view?a=1&b=2&c=3
-     * @param jsonObject 闄勫姞鏁版嵁
-     * @param callBack   鐩戝惉灏忕▼搴廜therUniMPEvent浜嬩欢
-     */
     public void openUniMP(String uniAppId, String path, JSONObject jsonObject, IOnOtherUniMPEventCallBack callBack) {
         if (TextUtils.isEmpty(uniAppId)) {
             HdlThreadLogic.toast(mContext, "uni Id null");
@@ -279,14 +276,22 @@
                 UniMPOpenConfiguration uniMPOpenConfiguration = new UniMPOpenConfiguration();
                 uniMPOpenConfiguration.path = path;
                 uniMPOpenConfiguration.extraData = jsonObject;
+                uniMPOpenConfiguration.splashClass = MySplashView.class;
                 uniMP = DCUniMPSDK.getInstance().openUniMP(mContext, uniAppId, uniMPOpenConfiguration);
+            }
+            //android14鏈変簺璁惧鏈夐棶棰橈紝闇�瑕佺瓑寰�
+            if (android.os.Build.VERSION.SDK_INT >= 34) {
+                if (TextUtils.isEmpty(mCurrentAppId)) {
+                    //绗竴娆$敤瑕佷紤鐪�
+                    SystemClock.sleep(1000);
+                }
             }
             mCurrentAppId = uniAppId;//璁板綍褰撳墠灏忕▼搴�
             mUniMPCaches.put(uniMP.getAppid(), uniMP);
         } catch (Exception e) {
             e.printStackTrace();
             HdlThreadLogic.toast(HDLApp.getInstance(), R.string.uni_open_error);
-            initDCUniMPSDK(HDLApp.getInstance());
+//            initDCUniMPSDK(HDLApp.getInstance());
             HdlLogLogic.print("鎵撳紑澶辫触===" + e.getMessage());
         }
     }

--
Gitblit v1.8.0