Fix CUJ UiThread detection when only a SurfaceControl is provided
Most methods annotated with @UiThread were not actually running on the UI thread related to the CUJ (when its ui thread was different than the app main thread).
When deferred monitoring was true (the default case), everything was fine, as the "begin" method eventually goes to the choreographer, and is scheduled on the correct UI thread.
When deferred monitoring was true and only a surface was provided though, the "begin" method was being executed
Bug: 363884280
Test: FrameTrackerTest and Checked ui thread associated with splashscreen CUJs and fold animation
Flag: NONE recent bugfix
Change-Id: I3aa1e67b50d47f1eb6ae5c896e53f6955298e750
34 files changed