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

Commit f12a1f10 authored by Evan Laird's avatar Evan Laird
Browse files

Log number of known dependencies if Dependency throws an exception

This can provide a modicum of insight into why Dependency may be failing
to retrieve the required class. If, for instance, there is a race
condition then we would expect to see a smaller number of known
dependencies.

Dependency.

Bug: 65560049
Test: request a non-registered depdency from Depdency.java, then read
the logs.

Change-Id: I583287d0b59da321ab590f53a86c2d9b357304b2
parent 6f76cee0
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -348,7 +348,8 @@ public class Dependency extends SystemUI {
        @SuppressWarnings("unchecked")
        DependencyProvider<T> provider = mProviders.get(cls);
        if (provider == null) {
            throw new IllegalArgumentException("Unsupported dependency " + cls);
            throw new IllegalArgumentException("Unsupported dependency " + cls
                    + ". " + mProviders.size() + " providers known.");
        }
        return provider.createDependency();
    }