| 4 | import dagger.ObjectGraph; |
| 5 | |
| 6 | public final class Injector { |
| 7 | private static final String INJECTOR_SERVICE = "com.jakewharton.u2020.injector"; |
| 8 | |
| 9 | @SuppressWarnings({"ResourceType", "WrongConstant"}) // Explicitly doing a custom service. |
| 10 | public static ObjectGraph obtain(Context context) { |
| 11 | return (ObjectGraph) context.getSystemService(INJECTOR_SERVICE); |
| 12 | } |
| 13 | |
| 14 | public static boolean matchesService(String name) { |
| 15 | return INJECTOR_SERVICE.equals(name); |
| 16 | } |
| 17 | |
| 18 | private Injector() { |
| 19 | throw new AssertionError("No instances."); |
| 20 | } |
| 21 | } |
nothing calls this directly
no outgoing calls
no test coverage detected