From 43c9d4848414af54acec0d3a4fa34d7d77487dfa Mon Sep 17 00:00:00 2001
From: lmw <125975490@qq.com>
Date: 星期二, 18 四月 2023 11:07:55 +0800
Subject: [PATCH] 修改隐私相关

---
 app/src/main/java/com/fuban/driver/base/MyApplication.kt |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/app/src/main/java/com/fuban/driver/base/MyApplication.kt b/app/src/main/java/com/fuban/driver/base/MyApplication.kt
index 907dc61..396e58a 100644
--- a/app/src/main/java/com/fuban/driver/base/MyApplication.kt
+++ b/app/src/main/java/com/fuban/driver/base/MyApplication.kt
@@ -68,6 +68,17 @@
         handleSSLHandshake()
         //如果是主进程
         XUI.init(this)
+        registerActivityLifecycleCallbacks(this)
+//        CrashReport.initCrashReport(getApplicationContext(), "444bb776ed", false);
+        LogUtils.OpenLog(true)
+        initUpPoint()
+        initSocket()
+    }
+
+    /**
+     * 延迟初始化,在用户同意隐私协议后进行
+     */
+    fun initSdk(){
         UMConfigure.init(
             this,
             "640ae80cba6a5259c41ab641",
@@ -75,13 +86,8 @@
             UMConfigure.DEVICE_TYPE_PHONE,
             ""
         )
-        registerActivityLifecycleCallbacks(this)
         PlatformConfig.setWeixin("wx19a713b4943f9568", "5d4ca951a855b1e2c86a844cd42fd133")
         PlatformConfig.setQQZone("1112151767", "5viZ7mQkNkYtUr7b") //qq互联
-//        CrashReport.initCrashReport(getApplicationContext(), "444bb776ed", false);
-        LogUtils.OpenLog(true)
-        initUpPoint()
-        initSocket()
         JPushInterface.setDebugMode(true)
         JPushInterface.init(this)
         setAlisa()
@@ -401,6 +407,7 @@
 
     companion object {
         private const val TAG = "MyApplication"
+        var canPlayVoice = false //进入主页才可以播放语言通知
         protected var mTtsManager: TTSController? = null
         public var isLogin: Boolean = true
 
@@ -502,7 +509,8 @@
         showNum--
         Handler(Looper.getMainLooper()).postDelayed({
             if (showNum == 0) {
-                getTTsManager().setVideoText("福伴出行司机已置于后台,可能会导致听单异常,里程计费差异,请勿切换。")
+                if (canPlayVoice)
+                    getTTsManager().setVideoText("福伴司机已置于后台,可能会导致听单异常,里程计费差异,请勿切换。")
             }
         }, 600)
 

--
Gitblit v1.7.1