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
diff --git a/packages/SystemUI/src/com/android/systemui/Dependency.java b/packages/SystemUI/src/com/android/systemui/Dependency.java
index a9a915b..2937a25 100644
--- a/packages/SystemUI/src/com/android/systemui/Dependency.java
+++ b/packages/SystemUI/src/com/android/systemui/Dependency.java
@@ -348,7 +348,8 @@
@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();
}