diff options
| author | 2022-12-17 01:08:07 +0000 | |
|---|---|---|
| committer | 2022-12-17 01:08:07 +0000 | |
| commit | d85adb46345dd38fab84aabc60f6ca1d4cfe23d3 (patch) | |
| tree | 097da3e4655e48802ca01049d2a7aff08d2cb6d1 | |
| parent | ffc64ac33e321ea0c7e176602ccf91330c80e893 (diff) | |
| parent | 2d55b23e7dec99a7f9e5d3e6872810b5da5013ce (diff) | |
Merge "Logspam: Properly handle optional app widgets service"
| -rw-r--r-- | core/java/android/app/SystemServiceRegistry.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/java/android/app/SystemServiceRegistry.java b/core/java/android/app/SystemServiceRegistry.java index f494fa6ce6e4..db1db91752e0 100644 --- a/core/java/android/app/SystemServiceRegistry.java +++ b/core/java/android/app/SystemServiceRegistry.java @@ -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, |