Slightly disentangle `MediaBrowser/Controller(Impl)Base/Legacy`
These constructors are currently very intertwined, passing `this` references from the constructor of one to the constructor of another before the first constructor is complete (and so the `this` reference isn't really valid yet). This change uses checker framework `@UnderInitialization` and `@NotOnlyInitialized` annotations to make it more clear that the references are not available yet. For the one 'direct' access needed in the second constructor (calling `getApplicationLooper()`) we now pass the `applicationLooper` directly alongside (to avoid needing to dereference the reference 'too early'). This change also ensures that where a class hierarchy has a 'dependent' class hierarchy, the 'subclass' instance is always used (by both subclass and superclass) without casting or manually hiding the superclass field, by defining an overridable `getFoo()` method instead and always using it. #minor-release PiperOrigin-RevId: 462335043
Showing
with
146 additions
and
95 deletions
This diff is collapsed.
Click to expand it.
Please
register
or
sign in
to comment