diff --git a/matrix/matrix-android/matrix-trace-canary/src/main/java/com/tencent/matrix/trace/core/UIThreadMonitor.java b/matrix/matrix-android/matrix-trace-canary/src/main/java/com/tencent/matrix/trace/core/UIThreadMonitor.java index 8dfb6604f..ab79a7da2 100644 --- a/matrix/matrix-android/matrix-trace-canary/src/main/java/com/tencent/matrix/trace/core/UIThreadMonitor.java +++ b/matrix/matrix-android/matrix-trace-canary/src/main/java/com/tencent/matrix/trace/core/UIThreadMonitor.java @@ -249,8 +249,9 @@ private void doFrameEnd(long token) { } private void dispatchEnd() { + final boolean localBelongFrame = isBelongFrame; - if (isBelongFrame) { + if (localBelongFrame) { doFrameEnd(token); } @@ -260,7 +261,7 @@ private void dispatchEnd() { synchronized (observers) { for (LooperObserver observer : observers) { if (observer.isDispatchBegin()) { - observer.doFrame(AppMethodBeat.getVisibleScene(), token, SystemClock.uptimeMillis(), isBelongFrame ? end - start : 0, queueCost[CALLBACK_INPUT], queueCost[CALLBACK_ANIMATION], queueCost[CALLBACK_TRAVERSAL]); + observer.doFrame(AppMethodBeat.getVisibleScene(), token, SystemClock.uptimeMillis(), localBelongFrame ? end - start : 0, queueCost[CALLBACK_INPUT], queueCost[CALLBACK_ANIMATION], queueCost[CALLBACK_TRAVERSAL]); } } } @@ -273,7 +274,7 @@ private void dispatchEnd() { synchronized (observers) { for (LooperObserver observer : observers) { if (observer.isDispatchBegin()) { - observer.dispatchEnd(dispatchTimeMs[0], dispatchTimeMs[2], dispatchTimeMs[1], dispatchTimeMs[3], token, isBelongFrame); + observer.dispatchEnd(dispatchTimeMs[0], dispatchTimeMs[2], dispatchTimeMs[1], dispatchTimeMs[3], token, localBelongFrame); } } }