修改测试程序compileSdkVersion 版本 以及删除无用类

This commit is contained in:
xinfengkun
2022-04-02 15:46:08 +08:00
parent a9a7acc302
commit 5790863f80
3 changed files with 2 additions and 55 deletions

View File

@@ -1,7 +1,7 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 31
compileSdkVersion rootProject.ext.android.compileSdkVersion
defaultConfig {
applicationId "com.zhidao.adas.client"
minSdkVersion 21

View File

@@ -1,51 +0,0 @@
package com.zhidao.adas.client.log;
import android.graphics.Color;
import android.text.TextUtils;
//保存的log
public class LogModel {
public interface ACTION {
String SEND = "发送";
String RECEIVE = "接收";
String PARSE = "解析";
}
public long id;
public int op_code;//发送Mask 接收:数据帧类型
public String action;//log标签
public String data;//log数据
public String time;
public LogModel() {
}
public LogModel(String action, int op_code, String data) {
this.action = action;
this.op_code = op_code;
this.data = data;
}
public int getColor() {
if (TextUtils.isEmpty(action)) {
return Color.parseColor("#871f78");
}
switch (action) {
case ACTION.SEND:
// return 0xFA8072;
return Color.parseColor("#FA8072");
case ACTION.RECEIVE:
// return 0xDCDCDC;
return Color.parseColor("#FF00FF");
case ACTION.PARSE:
// return 0xDCDCDC;
return Color.parseColor("#228B22");
default:
// return 0xFFFFFF;
return Color.parseColor("#871f78");
}
}
}

View File

@@ -34,7 +34,7 @@ public class LogSave {
private static final String ROOT_PATH = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "IPCMonitoring" + File.separator;//程序外部存储跟目录
private static final String LOG_FILE_NAME = "data%s.log";//文件名称
private volatile static LogSave INSTANCE;
private static final long MAX_CAPACITY = 2 * 1024 * 1024L;//单文件最大存储容量 kb
private static final long MAX_CAPACITY = 5 * 1024 * 1024L;//单文件最大存储容量 kb
private final LinkedBlockingQueue<String> queue;
private BufferedWriter buff = null;
private final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS", Locale.getDefault());
@@ -99,8 +99,6 @@ public class LogSave {
if (isLogSwitch) {
long nowTime = System.currentTimeMillis();
String time = sdf.format(new Date(nowTime));
// L.i(TAG, "time=" + time);
data = data.replace("\n", "");
String builder = time + " [action]:" + action + " [data]:" + data;
queue.add(builder);
}