[dev_arch_opt_3.0] 去掉下载通知栏提示,调试面板添加车信息数据展示

This commit is contained in:
lixiaopeng
2023-03-07 19:07:37 +08:00
parent 591c3c2339
commit a6d82645f5
4 changed files with 37 additions and 15 deletions

View File

@@ -86,10 +86,18 @@ class BindingCarNetWorkManager private constructor() {
SharedPrefsConstants.CAR_INFO,
GsonUtils.toJson(info.getData())
)
} else {
SharedPrefsMgr.getInstance(context).putString(
SharedPrefsConstants.CAR_INFO, "null")
e(
SceneConstant.M_BINDING + TAG, "getBindingCarInfo data = null "
)
}
}
override fun onError(e: Throwable) {
SharedPrefsMgr.getInstance(context).putString(
SharedPrefsConstants.CAR_INFO, e.message.toString())
e(
SceneConstant.M_BINDING + TAG,
"getBindingCarInfo onError e = " + e.toString() + "---e.getMessage = " + e.message

View File

@@ -1,8 +1,6 @@
package com.zhjt.mogo_core_function_devatools.upgrade
import android.app.NotificationManager
import android.content.Context
import androidx.core.app.NotificationCompat
import com.elegant.utils.UiThreadHandler
import com.mogo.eagle.core.data.obu.MogoObuConst
import com.mogo.eagle.core.function.api.devatools.IMogoDevaToolsUpgradeListener
@@ -128,31 +126,20 @@ class UpgradeManager : IDownload {
}
/**
* 鹰眼app下载监听 liyz
* 鹰眼app下载监听
*/
fun updateUpgradeProgress(context: Context) {
val builder = NotificationCompat.Builder(context)
// builder.setSmallIcon(R.mipmap.icon1001);//todo emArrow 更换图标,去除地图下载图标的依赖关系
builder.setContentTitle("下载")
builder.setContentText("正在下载")
val manager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
CallerDevaToolsUpgradeListenerManager.addListener(
TAG,
object : IMogoDevaToolsUpgradeListener {
override fun onStart(url: String?) {}
override fun onPause(url: String?) {}
override fun onProgress(url: String?, length: Int) {
builder.setProgress(100, length, false)
manager.notify(0x3, builder.build())
//下载进度提示
builder.setContentText("已下载$length%")
updateStatusBarDownloadView(true, "download", length)
}
override fun onFinished(url: String?) {
builder.setContentText("已下载" + 100 + "%")
UiThreadHandler.postDelayed({
manager.cancel(0x3)
updateStatusBarDownloadView(false, "download", 100)
}, 1000)
}

View File

@@ -21,6 +21,7 @@ import chassis.Chassis
import chassis.ChassisStatesOuterClass
import com.mogo.cloud.passport.MoGoAiCloudClient
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.commons.constants.SharedPrefsConstants
import com.mogo.commons.debug.DebugConfig
import com.mogo.commons.module.status.MogoStatusManager
import com.mogo.eagle.core.data.app.AppConfigInfo
@@ -206,7 +207,6 @@ internal class DebugSettingView @JvmOverloads constructor(
CallerChassisGearStateListenerManager.addListener(TAG, this)
CallerChassisSteeringStateListenerManager.addListener(TAG, this)
CallerChassisThrottleStateListenerManager.addListener(TAG, this)
//添加 开发套件工具接口 监听
CallerDevaToolsListenerManager.addListener(TAG, this)
//添加 底盘灯光数据 监听
@@ -257,6 +257,7 @@ internal class DebugSettingView @JvmOverloads constructor(
CallerChassisLamplightListenerManager.removeListener(TAG)
// 移除 obu获取信息 监听
CallerObuInfoListenerManager.removeListener(TAG)
// 移除 业务配置监听
CallerDevaToolsFuncConfigListenerManager.unRegisterDevaToolsFuncConfigListener(
FuncBizConfig.FOUNDATION,
@@ -359,6 +360,7 @@ internal class DebugSettingView @JvmOverloads constructor(
swDevelopMode.visibility = View.GONE
}
}
/**
* 开发者模式
*/
@@ -1589,6 +1591,7 @@ internal class DebugSettingView @JvmOverloads constructor(
tvAutopilotInfo.text = autopilotJson
tvIpcInfo.text = autopilotJson
tvIpcInfoKey.text = autopilotJson
tvCmdbCarInfoContent.text = SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.CAR_INFO)
tvCarInfo.text =
"GPS时间${(mGnssInfo?.satelliteTime?.times(1000))?.toLong()}\n" +
@@ -2046,4 +2049,5 @@ internal class DebugSettingView @JvmOverloads constructor(
override fun onObuDeviceId(obuDeviceId: String) {
mObuDeviceId = obuDeviceId
}
}

View File

@@ -206,6 +206,29 @@
android:layout_height="1dp"
android:background="#F0F0F0" />
<TextView
android:id="@+id/tvCmdbCarInfo"
style="@style/DebugSettingText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="车辆信息: " />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F0F0F0" />
<TextView
android:id="@+id/tvCmdbCarInfoContent"
style="@style/DebugSettingText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minLines="5" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F0F0F0" />
<ToggleButton
android:id="@+id/tbIsDemoMode"
android:layout_width="match_parent"