[6.3.0][卡顿检测] 代码逻辑优化
This commit is contained in:
@@ -2,8 +2,6 @@ package com.mogo.launcher.lancet.jank.spi;
|
||||
import android.app.Activity;
|
||||
import android.os.Looper;
|
||||
import android.os.SystemClock;
|
||||
import android.util.Log;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
import com.knightboost.lancet.api.synchronized_lock.SynchronizedLockHooker;
|
||||
import com.mogo.core.lancetx.compiler.lib.generator.Type;
|
||||
@@ -117,8 +115,7 @@ public class HookInvokerImpl implements IHookInvoker {
|
||||
|
||||
private void handleCostTimeRecord(Type type, String extra, Object caller, String methodName, long cost, Object... args) {
|
||||
//日志打印阈值
|
||||
long logThreshold = 5;
|
||||
if (cost >= logThreshold) {
|
||||
if (cost >= 5) {
|
||||
StringBuilder builder = message.get();
|
||||
if (builder == null) {
|
||||
builder = new StringBuilder();
|
||||
@@ -142,7 +139,7 @@ public class HookInvokerImpl implements IHookInvoker {
|
||||
if (o == null) {
|
||||
continue;
|
||||
}
|
||||
builder.append(o)
|
||||
builder.append((o instanceof Class) ? ((Class) o).getName() : o.getClass().getName())
|
||||
.append(",");
|
||||
}
|
||||
} else {
|
||||
@@ -152,7 +149,7 @@ public class HookInvokerImpl implements IHookInvoker {
|
||||
if (o == null) {
|
||||
continue;
|
||||
}
|
||||
builder.append(o)
|
||||
builder.append((o instanceof Class) ? ((Class) o).getName() : o.getClass().getName())
|
||||
.append(",");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user