Defer AnimatorTestRule Handler until used by tests.
As part of supporting SysUI multivalentTests under the new Ravenwood testing environment, tests need to be more careful about only creating and interacting with "complex" objects when they're actually needed by a test. Attempting interactions during <init> or <clinit> of the overall test class fails on Ravenwood when these complex objects aren't yet supported, and they throw an exception. This change focuses on `AnimatorTestRule`, which attempts to unconditionally create an `AnimationHandler` internally; it migrates the actual creation to become lazy via a `Singleton` pattern, so that we only construct it when actually needed by a test. Bug: 319647875 Test: atest SystemUiRoboTests Change-Id: Iec1c2d63062466527688e929b66f01631511f47a
Loading
Please register or sign in to comment