Merge "Logspam: Properly handle optional app widgets service" am: d85adb4634 am: a9acc01937
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2276551 Change-Id: Ice28df3ad362c1677b7ea4be6fa3f5e4327eaddc Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -1027,9 +1027,10 @@ public final class SystemServiceRegistry {
|
|||||||
registerService(Context.APPWIDGET_SERVICE, AppWidgetManager.class,
|
registerService(Context.APPWIDGET_SERVICE, AppWidgetManager.class,
|
||||||
new CachedServiceFetcher<AppWidgetManager>() {
|
new CachedServiceFetcher<AppWidgetManager>() {
|
||||||
@Override
|
@Override
|
||||||
public AppWidgetManager createService(ContextImpl ctx) throws ServiceNotFoundException {
|
public AppWidgetManager createService(ContextImpl ctx) {
|
||||||
IBinder b = ServiceManager.getServiceOrThrow(Context.APPWIDGET_SERVICE);
|
IBinder b = ServiceManager.getService(Context.APPWIDGET_SERVICE);
|
||||||
return new AppWidgetManager(ctx, IAppWidgetService.Stub.asInterface(b));
|
return b == null ? null : new AppWidgetManager(ctx,
|
||||||
|
IAppWidgetService.Stub.asInterface(b));
|
||||||
}});
|
}});
|
||||||
|
|
||||||
registerService(Context.MIDI_SERVICE, MidiManager.class,
|
registerService(Context.MIDI_SERVICE, MidiManager.class,
|
||||||
|
|||||||
Reference in New Issue
Block a user