From e3607d2cc7296568fa4f56b537529da70cb09188 Mon Sep 17 00:00:00 2001 From: Jerome Gaillard Date: Thu, 24 Nov 2016 16:19:42 +0000 Subject: [PATCH] Add missing ServiceNotFoundException class This class was added in ServiceManager.java in commit 49ca529a85. Layoutlib rewrites the entire ServiceManager class, so it also needs to define ServiceNotFoundException. Test: TestDelegates.testMethodDelegates Change-Id: Ia68399e8baa973ae961eabe929ca3d1019f20ba7 --- .../bridge/src/android/os/ServiceManager.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tools/layoutlib/bridge/src/android/os/ServiceManager.java b/tools/layoutlib/bridge/src/android/os/ServiceManager.java index 549074d157576..3e1ec070c7d96 100644 --- a/tools/layoutlib/bridge/src/android/os/ServiceManager.java +++ b/tools/layoutlib/bridge/src/android/os/ServiceManager.java @@ -71,4 +71,18 @@ public final class ServiceManager { public static void initServiceCache(Map cache) { // pass } + + /** + * Exception thrown when no service published for given name. This might be + * thrown early during boot before certain services have published + * themselves. + * + * @hide + */ + public static class ServiceNotFoundException extends Exception { + // identical to the original implementation + public ServiceNotFoundException(String name) { + super("No service published for: " + name); + } + } }