This commit is contained in:
zhongchao
2022-10-26 15:37:00 +08:00
parent 16c7bd9755
commit 5fcd887dff
10 changed files with 42 additions and 38 deletions

View File

@@ -1,5 +1,7 @@
package com.mogo.eagle.core.function.appupgrade.network;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BINDING;
import android.content.Context;
import android.util.Log;
@@ -56,8 +58,7 @@ public class UpgradeAppNetWorkManager {
// String mac = "48:b0:2d:3a:bc:78";
String sn = MoGoAiCloudClientConfig.getInstance().getSn();
int versionCode = AppUtils.getAppVersionCode();
CallerLogger.INSTANCE.d(TAG, "getAppUpgradeInfo mac = " + mac + "---type = " + screenType + "---sn = " + sn + "---versionCode =" + versionCode);
Log.d(TAG, "mac = " + mac + "---type = " + screenType + "---sn = " + sn + "---versionCode =" + versionCode);
CallerLogger.INSTANCE.d(M_BINDING + TAG, "getAppUpgradeInfo mac = " + mac + "---type = " + screenType + "---sn = " + sn + "---versionCode =" + versionCode);
UpgradeAppRequest request = new UpgradeAppRequest(sn, mac, screenType);
RequestBody requestBody = RequestBody.create(MediaType.get("application/json;charset=UTF-8"), GsonUtil.jsonFromObject(request));
mUpgradeApiService.getUpgradeInfo(requestBody)
@@ -71,14 +72,14 @@ public class UpgradeAppNetWorkManager {
@Override
public void onNext(@NonNull UpgradeAppInfo info) {
if (info != null && info.result != null) {
CallerLogger.INSTANCE.d(TAG, "UpgradeAppInfo url = " + info.result.getAppUrl() + "----code = " + info.result.getVersionCode());
CallerLogger.INSTANCE.d(M_BINDING + TAG, "UpgradeAppInfo url = " + info.result.getAppUrl() + "----code = " + info.result.getVersionCode());
Log.d(TAG, "UpgradeAppInfo url = " + info.result.getAppUrl() + "----code = " + info.result.getVersionCode() + "--versionCode =" + versionCode + "--info.result = " + info.result);
if (info.result.getVersionCode() > versionCode) {
CallerHmiManager.INSTANCE.showUpgradeDialog(info.result.getAppUrl().substring(info.result.getAppUrl().lastIndexOf("/")+1), info.result.getAppUrl(), info.result.getInstallTitle(), info.result.getInstallContent(), info.result.getInstallType());
}
} else {
Log.e(TAG, "onNext info == null");
CallerLogger.INSTANCE.d(TAG, "UpgradeAppInfo onNext info == null");
CallerLogger.INSTANCE.d(M_BINDING + TAG, "UpgradeAppInfo onNext info == null");
}
}

View File

@@ -1,7 +1,6 @@
package com.zhjt.mogo_core_function_devatools.funcconfig
import android.content.Context
import android.util.Log
import com.mogo.aicloud.services.socket.IMogoOnMessageListener
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager
import com.mogo.commons.AbsMogoApplication
@@ -67,7 +66,6 @@ class FuncConfigCenter : IMogoOnMessageListener<FuncConfig>, IMoGoAutopilotCarCo
}
override fun onMsgReceived(obj: FuncConfig?) {
Log.d(TAG, "onMsgReceived Business : $obj")
obj?.let {
invokeUpdate(it)
}
@@ -82,11 +80,11 @@ class FuncConfigCenter : IMogoOnMessageListener<FuncConfig>, IMoGoAutopilotCarCo
clientPkFileName = "sn"
)
private fun refreshConfig(funcConfig: FuncConfig) {
BizManager.updateBizConfigData(funcConfig)
invokeUpdate(funcConfig)
}
private fun invokeUpdate(funcConfig: FuncConfig) {
BizManager.updateBizConfigData(funcConfig)
funcConfig.business.forEach { business ->
CallerDevaToolsFuncConfigListenerManager.invokeDevaToolsFuncConfigBizUpdate(
business.biz.uppercase(),

View File

@@ -23,7 +23,10 @@ object FuncConfigImpl {
data: String?
) {
when (type) {
}
BIZ_BEAUTY_MODE -> FunctionBuildConfig.isDemoMode = state
BIZ_RAIN_MODE -> FunctionBuildConfig.isRainMode = state
BIZ_WARNING_UPLOAD -> FunctionBuildConfig.isReportWarning = state
}
}
}
)

View File

@@ -34,13 +34,9 @@ class FuncConfigNetWorkModel {
if (error == null) {
error = onError
}
//todo test
// map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
map["sn"] = "X20202203105S688HZ"
// map["mac"] = DeviceUtils.getMacAddress()
map["mac"] = "48:b0:2d:3a:bc:78"
// map["channelVersion"] = FuncConfigConst.getChannelCode()
map["channelVersion"] = 1
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
map["mac"] = DeviceUtils.getMacAddress()
map["channelVersion"] = FuncConfigConst.getChannelCode()
}
loader {
apiCall {

View File

@@ -62,6 +62,7 @@ import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.function.hmi.ui.logcatch.ILogViewListener
import com.mogo.eagle.core.function.hmi.ui.logcatch.LogInfoView
import com.mogo.eagle.core.function.hmi.ui.upgrade.UpgradeListAdapter
import com.mogo.eagle.core.function.hmi.ui.widget.BlueToothView
import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView
import com.mogo.eagle.core.utilcode.kotlin.onClick
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
@@ -574,7 +575,7 @@ class DebugSettingView @JvmOverloads constructor(
// 演示模式
tbIsDemoMode.setOnCheckedChangeListener { _, isChecked ->
CallerHmiManager.updateStatusBarRightView(isChecked,"demoMode", DemoModeView(context))
CallerHmiManager.updateStatusBarRightView(isChecked, "demoMode", DemoModeView(context))
CallerAutoPilotManager.setDemoMode(isChecked)
if (!isChecked) {
//关闭美化模式时,通知工控机
@@ -1859,29 +1860,35 @@ class DebugSettingView @JvmOverloads constructor(
override fun updateBizData(type: String, state: Boolean, lock: Boolean, data: String?) {
when (type) {
BIZ_BEAUTY_MODE -> {
if(lock){
tbIsDemoMode.background = resources.getDrawable(R.drawable.radio_button_lock_background)
}else{
tbIsDemoMode.background = resources.getDrawable(R.drawable.radio_button_normal_background_right)
if (lock) {
tbIsDemoMode.background =
resources.getDrawable(R.drawable.radio_button_lock_background)
} else {
tbIsDemoMode.background =
resources.getDrawable(R.drawable.radio_button_normal_background_right)
}
}
BIZ_RAIN_MODE -> {
if(lock){
tbIsRainMode.background = resources.getDrawable(R.drawable.radio_button_lock_background)
}else{
tbIsRainMode.background = resources.getDrawable(R.drawable.radio_button_normal_background_right)
if (lock) {
tbIsRainMode.background =
resources.getDrawable(R.drawable.radio_button_lock_background)
} else {
tbIsRainMode.background =
resources.getDrawable(R.drawable.radio_button_normal_background_right)
}
}
BIZ_WARNING_UPLOAD -> {
if(lock){
tbReportWarning.background = resources.getDrawable(R.drawable.radio_button_lock_background)
}else{
if (lock) {
tbReportWarning.background =
resources.getDrawable(R.drawable.radio_button_lock_background)
} else {
tbReportWarning.background = null
}
}
BIZ_BAG_RECORD -> {
if (lock) {
btnRecordBag.background = resources.getDrawable(R.drawable.radio_button_lock_background)
btnRecordBag.background =
resources.getDrawable(R.drawable.radio_button_lock_background)
} else {
btnRecordBag.requestFocus()
btnRecordBag.background = null
@@ -1889,7 +1896,8 @@ class DebugSettingView @JvmOverloads constructor(
}
BIZ_FULL_LOG -> {
if (lock) {
tbLogCatch.background = resources.getDrawable(R.drawable.radio_button_lock_background)
tbLogCatch.background =
resources.getDrawable(R.drawable.radio_button_lock_background)
} else {
tbLogCatch.requestFocus()
tbLogCatch.background = null

View File

@@ -11,6 +11,7 @@ import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.util.BarUtils
import com.mogo.eagle.core.utilcode.util.ScreenUtils
import kotlinx.android.synthetic.main.view_status_bar.view.*
import java.util.concurrent.CopyOnWriteArrayList
class StatusBarView @JvmOverloads constructor(
context: Context,
@@ -26,7 +27,7 @@ class StatusBarView @JvmOverloads constructor(
LayoutInflater.from(context).inflate(R.layout.view_status_bar, this, true)
}
private val rightViewList = mutableListOf<String>()
private val rightViewList = CopyOnWriteArrayList<String>()
override fun onAttachedToWindow() {
super.onAttachedToWindow()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 467 B

View File

@@ -3,6 +3,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginLeft="@dimen/dp_10"
android:orientation="horizontal">
<com.mogo.eagle.core.function.hmi.ui.widget.BatteryView
@@ -13,7 +14,7 @@
<ImageView
android:id="@+id/ivBatteryCharge"
android:layout_width="@dimen/dp_16"
android:layout_height="@dimen/dp_26"
android:layout_height="@dimen/dp_22"
android:layout_marginStart="@dimen/dp_6"
android:scaleType="fitXY"
android:src="@drawable/battery_charge"