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

Skip to content
Commit f6fe28d3 authored by cketti's avatar cketti Committed by Vincent Breitmoser
Browse files

Add Globals class so we can avoid passing Context through layers of code

If your class requires a Context instance make it a constructor argument. Then
create a static factory method that calls Globals.getContext(). The result can
then be passed to the constructor.
This allows testing individual classes using test doubles by directly invoking
the constructor and not having to deal with Globals. For integrated tests
spanning multiple classes you might have to use Globals.setContext().
parent 8b719a32
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