Fix some wrong-thread issues around animator management
Bug: 17372309
Fixes a case where UI thread and RT thread both used the same method
which wasn't safe for either of them.
Adds additional assertions & logging in unusual circumstances to
try and track down where the issue is occuring from.
Change-Id: I93d31a6fd0c5927259b67bdf96a475944226eee6
diff --git a/libs/hwui/Animator.cpp b/libs/hwui/Animator.cpp
index da65f38..4f3a573 100644
--- a/libs/hwui/Animator.cpp
+++ b/libs/hwui/Animator.cpp
@@ -161,6 +161,13 @@
return false;
}
+void BaseRenderNodeAnimator::forceEndNow(AnimationContext& context) {
+ if (mPlayState < FINISHED) {
+ mPlayState = FINISHED;
+ callOnFinishedListener(context);
+ }
+}
+
void BaseRenderNodeAnimator::callOnFinishedListener(AnimationContext& context) {
if (mListener.get()) {
context.callOnFinished(this, mListener.get());