Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android 13出现较多Sorting went bad, the start event should always be at index 0错误 #605

Open
charles-chai opened this issue Aug 25, 2023 · 2 comments · Fixed by #606 · May be fixed by #644
Open

Android 13出现较多Sorting went bad, the start event should always be at index 0错误 #605

charles-chai opened this issue Aug 25, 2023 · 2 comments · Fixed by #606 · May be fixed by #644

Comments

@charles-chai
Copy link
Contributor

Sorting went bad, the start event should always be at index 0
java.lang.UnsupportedOperationException: Sorting went bad, the start event should always be at index 0
at android.animation.AnimatorSet.sortAnimationEvents(AnimatorSet.java:1638)
at android.animation.AnimatorSet.createDependencyGraph(AnimatorSet.java:1534)
at android.animation.AnimatorSet.getTotalDuration(AnimatorSet.java:1745)
at android.animation.AnimationHandler.lambda$new$0$android-animation-AnimationHandler(AnimationHandler.java:224)
at android.animation.AnimationHandler$$ExternalSyntheticLambda0.doFrame(Unknown Source:2)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1384)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1394)
at android.view.Choreographer.doCallbacks(Choreographer.java:1013)
at android.view.Choreographer.doFrame(Choreographer.java:904)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1366)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:211)
at android.os.Looper.loop(Looper.java:300)
at android.app.ActivityThread.main(ActivityThread.java:8152)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1028)

@charles-chai
Copy link
Contributor Author

charles-chai commented Aug 25, 2023

问题原因:
这个问题和锁屏时google新增的动画处理逻辑相关。
之前版本中,锁屏后无限循环的动画依然会触发,谷歌对这个问题进行了处理;这个处理导致Android13上的动画会崩溃并报错。

https://android.googlesource.com/platform/frameworks/base/+blame/4440afb9352b326fca3840bac64bd4b6df491413/core/java/android/animation/AnimationHandler.java

    /**
161	     * This method is called from ViewRootImpl or WallpaperService when either a window is no
162	     * longer visible (enable == false) or when a window becomes visible (enable == true).
163	     * If animators are not properly disabled when activities are backgrounded, it can lead to
164	     * unnecessary processing, particularly for infinite animators, as the system will continue
165	     * to pulse timing events even though the results are not visible. As a workaround, we
166	     * pause all un-paused infinite animators, and resume them when any window in the process
167	     * becomes visible.
168	     */
169	    public static void requestAnimatorsEnabled(boolean enable, Object requestor) {
170	        getInstance().requestAnimatorsEnabledImpl(enable, requestor);
171	    }

charles-chai added a commit to charles-chai/hapjs that referenced this issue Aug 25, 2023
Zhuyongjun-OPPO pushed a commit that referenced this issue Dec 18, 2023
Signed-off-by: chaihua1 <chaihua1@xiaomi.com>
@jianghai33 jianghai33 reopened this Jan 4, 2024
charles-chai added a commit to charles-chai/hapjs that referenced this issue Jan 4, 2024
@charles-chai
Copy link
Contributor Author

复现方法:"router_uri":"hap://app/com.lingmao.quickapp/reader?PARAM_PAGE_ANIMATION=%7B%22openEnter%22%3A%22none%22%2C%22closeEnter%22%3A%22none%22%2C%22openExit%22%3A%22none%22%2C%22closeExit%22%3A%22none%22%7D&recommended_position_name=deeplink&chapterId=&last_page=%E9%A6%96%E9%A1%B5&recommended_page_name=&recommended_position_id=&recommended_plate_name=&bookId=221195" 使用这个uri进行跳转,然后过滤日志 ExtensionManager,在快应用打开,图标闪过白屏的时候立刻切到后台,这时候日志如果显示调用了system.animation enable/play 方法,等待10s中左右框架就会崩溃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants