diff --git a/core/java/android/app/SystemServiceRegistry.java b/core/java/android/app/SystemServiceRegistry.java index bdecca379b202..277a24f654131 100644 --- a/core/java/android/app/SystemServiceRegistry.java +++ b/core/java/android/app/SystemServiceRegistry.java @@ -1020,9 +1020,10 @@ public final class SystemServiceRegistry { registerService(Context.APPWIDGET_SERVICE, AppWidgetManager.class, new CachedServiceFetcher() { @Override - public AppWidgetManager createService(ContextImpl ctx) throws ServiceNotFoundException { - IBinder b = ServiceManager.getServiceOrThrow(Context.APPWIDGET_SERVICE); - return new AppWidgetManager(ctx, IAppWidgetService.Stub.asInterface(b)); + public AppWidgetManager createService(ContextImpl ctx) { + IBinder b = ServiceManager.getService(Context.APPWIDGET_SERVICE); + return b == null ? null : new AppWidgetManager(ctx, + IAppWidgetService.Stub.asInterface(b)); }}); registerService(Context.MIDI_SERVICE, MidiManager.class,