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

Skip to content
Commit 4de0b2c9 authored by Dave Mankoff's avatar Dave Mankoff
Browse files

Change CoreStartable @Dependencies to Injected Map

Using it as an annotation wasn't working - the compiler was stripping
it away for unknown reasons.

Replace it with a injected Map<Class, Set<Class>> where each
startable can simply provide a set of the other startables it cares
about.

One advantage of this is that the dependencies can not be provided
in the same module where the startable is bound. This means that
different impls of a given startable can list different dependencies.
Before, the dependencies were tied to the key, which could be an
interface shared across multiple different impls.

The reason this was done this way instead of a method on
CoreStartable is because we want to be able to get the list of
dependencies before constructing the startable - many of our
classes do work in the constructor. We could have tried to
reflectively call a static method on the key, but this would look like
an ugly hack; it would also prevent the advantage of specifying the
dependencies on a per-impl basis.

Bug: 333758389
Flag: NA
Test: locally run
Change-Id: If729483c4661428d4a1041f84f39cdc50f6f5645
parent 24caa927
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment