summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Evan Laird <evanlaird@google.com> 2017-09-13 14:05:37 -0400
committer Evan Laird <evanlaird@google.com> 2017-09-13 15:33:29 -0400
commitf12a1f10ee4ddc1c6b17156df49ccce240af472a (patch)
tree6aff9fdf1d0f3f86c55a75249a9276ab3d0c095c
parent6f76cee0a5788d9833f4d6ac72a945bb85042c1c (diff)
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
-rw-r--r--packages/SystemUI/src/com/android/systemui/Dependency.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/Dependency.java b/packages/SystemUI/src/com/android/systemui/Dependency.java
index a9a915b23a0c..2937a250140a 100644
--- a/packages/SystemUI/src/com/android/systemui/Dependency.java
+++ b/packages/SystemUI/src/com/android/systemui/Dependency.java
@@ -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();
}