opt sn binding

This commit is contained in:
lixiaopeng
2022-04-01 12:15:29 +08:00
parent 3d551b0f78
commit f30701a715
8 changed files with 52 additions and 13 deletions

View File

@@ -138,8 +138,8 @@ public class MoGoHandAdasMsgManager implements
@Override
public void onAutopilotCarConfig(@NotNull MessagePad.CarConfigResp carConfigResp) {
if (carConfigResp != null && !TextUtils.isEmpty(carConfigResp.getMacAddress())) {
// Log.d("liyz", "onAutopilotCarConfig ---------------------" + carConfigResp.getMacAddress() + "--" + carConfigResp.getPlateNumber());
// CallerBindingcarManager.getBindingcarProvider().getBindingcarInfo(carConfigResp.getMacAddress());
Log.d("liyz", "onAutopilotCarConfig ---------------------" + carConfigResp.getMacAddress() + "--lateNumber() = " + carConfigResp.getPlateNumber());
CallerBindingcarManager.getBindingcarProvider().getBindingcarInfo(carConfigResp.getMacAddress());
}
}

View File

@@ -1,17 +1,15 @@
package com.mogo.eagle.core.function.bindingcar;
import android.content.Context;
import android.text.TextUtils;
import android.util.Log;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.commons.constants.SharedPrefsConstants;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.data.config.HmiBuildConfig;
import com.mogo.eagle.core.data.constants.MogoServicePaths;
import com.mogo.eagle.core.function.api.bindingcar.BindingcarCallBack;
import com.mogo.eagle.core.function.api.bindingcar.IMoGoBindingcarProvider;
import com.mogo.eagle.core.function.bindingcar.network.BindingcarNetWorkManager;
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
import org.jetbrains.annotations.NotNull;
@@ -51,14 +49,8 @@ public class BindingcarProvider implements IMoGoBindingcarProvider {
@Override
public void getBindingcarInfo(String macAddress) {
mAddress = macAddress;
long currentHour = System.currentTimeMillis() / (1000 * 60 * 60);
long oldHour = SharedPrefsMgr.getInstance(mContext).getLong("type", 0);
Log.d("liyz", "getBindingcarInfo currentHour = " + currentHour + "---oldHour = " + oldHour);
//12小时内只调用一次防止用户不点击修改绑定导致的频繁提示用户第一次点击修改成功后就不会再提示了
if (currentHour - oldHour > 12) {
if (HmiBuildConfig.isShowSnBindingView) {
if (getScreenType() == 1) {
Log.d("liyz", "getBindingcarInfo getScreenType() -----> ");
SharedPrefsMgr.getInstance(mContext).putLong("type", System.currentTimeMillis() / (1000 * 60 * 60));
BindingcarNetWorkManager.getInstance().getBindingcarInfo(mContext, macAddress, getScreenType());
}
}
@@ -79,7 +71,6 @@ public class BindingcarProvider implements IMoGoBindingcarProvider {
} else if (FunctionBuildConfig.appIdentityMode == 1 || FunctionBuildConfig.appIdentityMode == 0xA1) {
screenType = 2; //乘客屏
}
Log.d("liyz", "mode = " + FunctionBuildConfig.appIdentityMode + "--screenType = " + screenType);
return screenType;
}

View File

@@ -3,6 +3,7 @@ package com.mogo.eagle.core.function.hmi.ui
import android.animation.Animator
import android.os.Bundle
import android.text.TextUtils
import android.util.Log
import android.view.Gravity
import android.view.View
import android.view.WindowManager
@@ -869,6 +870,10 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
HmiBuildConfig.isShowBrakeLightView = isOpen
}
override fun setSnBinding(isOpen: Boolean) {
HmiBuildConfig.isShowSnBindingView = isOpen
}
/**
* 展示工控机下载、升级状态信息
* @param upgradeMode 升级模式(提示升级、静默升级)

View File

@@ -889,6 +889,18 @@ class DebugSettingView @JvmOverloads constructor(
CallerHmiManager.setBrakeLightFunction(false)
}
}
/**
* sn绑定控制
*/
tbOpenSnBinding.setOnCheckedChangeListener { buttonView, isChecked ->
if (!isChecked) {
CallerHmiManager.setSnBinding(true)
} else {
CallerHmiManager.setSnBinding(false)
}
}
}
/**

View File

@@ -938,6 +938,16 @@
android:textOn="打开「刹车控制」"
android:textSize="@dimen/dp_24" />
<ToggleButton
android:id="@+id/tbOpenSnBinding"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_columnWeight="1"
android:layout_margin="2dp"
android:gravity="center"
android:textOff="关闭「SN绑定控制」"
android:textOn="打开「SN绑定控制」"
android:textSize="@dimen/dp_24" />
</GridLayout>
<ToggleButton