Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8753ef15 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Revert^2 "Reduce extra invocation of ThreadLocal in AnimationHandler"

It can return the non-null obtained instance directly.

Unfortunately, ThreadLocal.withInitial and override initialValue
may not be suitable to use, because getAnimationCount may not want
to create the instance.
Some special builds may insert generated code in constructor to
evaluate code coverage. And it may perform I/O operations that
violate StrictMode, and then StrictMode invokes
getCurrentAnimationsCount for dump, which accesses the ThreadLocal
and triggers initialization again. That leads to endless recursion.

Bug: 163976519
Flag: EXEMPT simple refactor
Test: atest ValueAnimatorTests
Change-Id: Id6e30e28279df8ac68b906afd2f59609e2568730
parent 8ddbaf6a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment