[merge] 合并接驳车代码

This commit is contained in:
wangmingjun
2023-01-16 17:27:27 +08:00
65 changed files with 2739 additions and 318 deletions

View File

@@ -3,17 +3,21 @@ package com.mogo.eagle.core.function.hmi.ui.dispatch;
import android.app.Dialog;
import android.content.Context;
import android.os.Build;
import android.view.Gravity;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.FrameLayout;
import androidx.annotation.NonNull;
import com.mogo.eagle.core.data.dispatch.DispatchAdasAutoPilotLocReceiverBean;
import com.mogo.eagle.core.function.hmi.R;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
public abstract class DispatchBaseDialog extends Dialog {
public DispatchBaseDialog(@NonNull Context context) {
super(context, R.style.Base_AlertDialog_AppCompat);
super(context,R.style.BaseFloatDialogStyle);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
getWindow().setType(WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY);
} else {
@@ -26,4 +30,22 @@ public abstract class DispatchBaseDialog extends Dialog {
public abstract void showDialog(DispatchAdasAutoPilotLocReceiverBean dispatchContent);
@Override
public void show() {
super.show();
setWindowSize();
}
private void setWindowSize(){
WindowManager.LayoutParams attributes = getWindow().getAttributes();
attributes.width = ViewGroup.LayoutParams.MATCH_PARENT;
attributes.height = ViewGroup.LayoutParams.MATCH_PARENT;
FrameLayout content = (FrameLayout)findViewById(android.R.id.content);
if(content!=null){
ViewGroup rootView = (ViewGroup) content.getChildAt(0);
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) rootView.getLayoutParams();
layoutParams.gravity = Gravity.CENTER;
rootView.setLayoutParams(layoutParams);
}
getWindow().setAttributes(attributes);
}
}

View File

@@ -60,9 +60,13 @@ import com.mogo.map.uicontroller.IMogoMapUIController;
import com.rousetime.android_startup.StartupManager;
import com.rousetime.android_startup.model.LoggerLevel;
import com.rousetime.android_startup.model.StartupConfig;
import com.zhjt.mogo_core_function_devatools.monitor.db.CpuInfo;
import com.zhjt.mogo_core_function_devatools.monitor.db.MemInfo;
import com.zhjt.mogo_core_function_devatools.monitor.db.MonitorDb;
import com.zhjt.service.chain.ChainLog;
import com.zhjt.service.chain.TracingConstants;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -264,6 +268,7 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
// 启动Native内存泄漏监测
startLeakMonitor();
}
checkMonitorDb();
}
private void startLeakMonitor() {
@@ -290,6 +295,25 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
LeakMonitor.INSTANCE.start();
}
private void checkMonitorDb() {
new Thread(() -> {
long limitId = 50001;
File file = this.getDatabasePath(MonitorDb.INTERNAL_DB_NAME);
try {
if (file != null && file.exists()) {
List<CpuInfo> cpuList = MonitorDb.getDb(this).monitorDao().getAllCPUById(limitId);
List<MemInfo> memList = MonitorDb.getDb(this).monitorDao().getAllMemById(limitId);
// 大于5w条清除
if (cpuList.size() > 0 || memList.size() > 0) {
this.deleteDatabase(MonitorDb.INTERNAL_DB_NAME);
}
}
} catch (Exception e) {
CallerLogger.INSTANCE.e(TAG, e.getMessage());
}
}).start();
}
@ChainLog(
linkChainLog = CHAIN_LINK_LOG_NATIVE_LEAK,
linkCode = CHAIN_LINK_LEAK,