[sonar] fix

This commit is contained in:
zhongchao
2023-10-18 19:42:58 +08:00
parent 523ae08c5a
commit c265850024
24 changed files with 91 additions and 139 deletions

View File

@@ -249,11 +249,7 @@ public class LogItemAdapter extends AbsRecyclerAdapter<AbsViewBinder<LogLine>, L
protected void publishResults(CharSequence constraint, FilterResults results) {
//noinspection unchecked
mList = (List<LogLine>) results.values;
if (results.count > 0) {
notifyDataSetChanged();
} else {
notifyDataSetChanged();
}
notifyDataSetChanged();
}
}
}

View File

@@ -25,6 +25,7 @@ public class LogLine {
"\\): ");
private static final String filterPattern = "ResourceType|memtrack|android.os.Debug|BufferItemConsumer|DPM.*|MDM.*|ChimeraUtils|BatteryExternalStats.*|chatty.*|DisplayPowerController|WidgetHelper|WearableService|DigitalWidget.*|^ANDR-PERF-.*";
private static final String failPattern = "^maxLineHeight.*|Failed to read.*";
private int logLevel;
private String tag;
private String logOutput;
@@ -57,7 +58,7 @@ public class LogLine {
char logLevelChar = matcher.group(1).charAt(0);
String logText = originalLine.substring(matcher.end());
if (logText.matches("^maxLineHeight.*|Failed to read.*")) {
if (logText.matches(failPattern)) {
logLine.setLogLevel(convertCharToLogLevel('V'));
} else {
logLine.setLogLevel(convertCharToLogLevel(logLevelChar));