From eb55ad78504174a25575c78bbc3ef2e9ce8f3bfd Mon Sep 17 00:00:00 2001 From: maxli Date: Tue, 10 Oct 2023 16:58:06 +0800 Subject: [PATCH] fix(android): revert sInForeground impl --- .../com/tencent/renderer/NativeRenderer.java | 2 -- .../renderer/utils/ChoreographerUtils.java | 16 +--------------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/renderer/native/android/src/main/java/com/tencent/renderer/NativeRenderer.java b/renderer/native/android/src/main/java/com/tencent/renderer/NativeRenderer.java index 402a1497b29..d8dc78ec43a 100644 --- a/renderer/native/android/src/main/java/com/tencent/renderer/NativeRenderer.java +++ b/renderer/native/android/src/main/java/com/tencent/renderer/NativeRenderer.java @@ -405,7 +405,6 @@ public void onResume() { listener.onInstanceResume(); } } - ChoreographerUtils.onResume(); } @Override @@ -415,7 +414,6 @@ public void onPause() { listener.onInstancePause(); } } - ChoreographerUtils.onPause(); } @MainThread diff --git a/renderer/native/android/src/main/java/com/tencent/renderer/utils/ChoreographerUtils.java b/renderer/native/android/src/main/java/com/tencent/renderer/utils/ChoreographerUtils.java index c74922a0377..ce113fe8088 100644 --- a/renderer/native/android/src/main/java/com/tencent/renderer/utils/ChoreographerUtils.java +++ b/renderer/native/android/src/main/java/com/tencent/renderer/utils/ChoreographerUtils.java @@ -26,7 +26,6 @@ public class ChoreographerUtils { public static final String DO_FRAME = "frameUpdate"; private static boolean sEnablePostFrame = false; - private static boolean sInForeground = true; private static HashMap> sListeners = null; private static void handleDoFrameCallback() { @@ -44,7 +43,7 @@ private static void handleDoFrameCallback() { private static void doPostFrame() { Choreographer.FrameCallback frameCallback = frameTimeNanos -> { - if (sEnablePostFrame && sInForeground) { + if (sEnablePostFrame) { handleDoFrameCallback(); doPostFrame(); } @@ -52,19 +51,6 @@ private static void doPostFrame() { Choreographer.getInstance().postFrameCallback(frameCallback); } - @MainThread - public static void onResume() { - sInForeground = true; - if (sEnablePostFrame) { - doPostFrame(); - } - } - - @MainThread - public static void onPause() { - sInForeground = false; - } - /** * Register frame callback listener, should call in ui thread. *