Merge "Logspam: Properly handle optional app widgets service"

This commit is contained in:
Treehugger Robot
2022-12-17 01:08:07 +00:00
committed by Gerrit Code Review

View File

@@ -1019,9 +1019,10 @@ public final class SystemServiceRegistry {
registerService(Context.APPWIDGET_SERVICE, AppWidgetManager.class,
new CachedServiceFetcher<AppWidgetManager>() {
@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,