[change] 优化重连,更换重连方案
This commit is contained in:
@@ -78,6 +78,7 @@ import com.zhidao.adas.client.bean.Warn;
|
||||
import com.zhidao.adas.client.log.ConnectStatusSave;
|
||||
import com.zhidao.adas.client.log.LogSave;
|
||||
import com.zhidao.adas.client.utils.Constants;
|
||||
import com.zhidao.adas.client.utils.PreferencesUtils;
|
||||
import com.zhidao.support.adas.high.AdasManager;
|
||||
import com.zhidao.support.adas.high.AdasOptions;
|
||||
import com.zhidao.support.adas.high.OnAdasConnectStatusListener;
|
||||
@@ -194,6 +195,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
onUpdateConnectStateView();
|
||||
showIPCIP();
|
||||
canDrawOverlays();
|
||||
showHint();
|
||||
// PowerManager powerManager = (PowerManager) getSystemService(POWER_SERVICE);
|
||||
// wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, TAG);
|
||||
// wakeLock.acquire();
|
||||
@@ -209,6 +211,28 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
// wifiLock.acquire();
|
||||
}
|
||||
|
||||
private void showHint() {
|
||||
boolean isShowHint = PreferencesUtils.getBoolean(this, "show_hint", true);
|
||||
if (isShowHint) {
|
||||
new AlertDialog.Builder(this)
|
||||
.setTitle("警告")
|
||||
.setMessage("本应用运行时会影响鹰眼司机、乘客端的连接。\n使用完成后请彻底杀掉本应用并重启鹰眼")
|
||||
.setNegativeButton("不再提示",
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
dialog.cancel();
|
||||
PreferencesUtils.putBoolean(MainActivity.this, "show_hint", false);
|
||||
}
|
||||
})
|
||||
.setPositiveButton("知道了",
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int whichButton) {
|
||||
}
|
||||
}).show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
@@ -536,7 +560,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
});
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
String str = "后台运行:" + (BackgrounderPermission.getInstance().isPermissionLongBackgroundRunning(this) ? "<font color='red'>已优化</font>" : "<font color='red'>未优化</font>");
|
||||
String str = "后台运行:" + (BackgrounderPermission.getInstance().isPermissionLongBackgroundRunning(this) ? "<font color='green'>已优化</font>" : "<font color='red'>未优化</font>");
|
||||
background.setText(Html.fromHtml(str, Html.FROM_HTML_MODE_LEGACY));
|
||||
background.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@@ -547,7 +571,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
BackgrounderPermission.getInstance().setListener(new OnAdasPermissionListener() {
|
||||
@Override
|
||||
public void onBackgrounderPermission(boolean isAllow) {
|
||||
String str = "后台运行:" + (isAllow ? "<font color='red'>已优化</font>" : "<font color='red'>未优化</font>");
|
||||
String str = "后台运行:" + (isAllow ? "<font color='green'>已优化</font>" : "<font color='red'>未优化</font>");
|
||||
background.setText(Html.fromHtml(str, Html.FROM_HTML_MODE_LEGACY));
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user