diff options
| author | 2022-12-17 02:03:09 +0000 | |
|---|---|---|
| committer | 2022-12-17 02:03:09 +0000 | |
| commit | a9acc019378aaefba89a54d42dcc0d39f7aaaddc (patch) | |
| tree | 097da3e4655e48802ca01049d2a7aff08d2cb6d1 | |
| parent | b34cf7692bff628ef8edaaa043b777b88c29243a (diff) | |
| parent | d85adb46345dd38fab84aabc60f6ca1d4cfe23d3 (diff) | |
Merge "Logspam: Properly handle optional app widgets service" am: d85adb4634
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2276551
Change-Id: Ibbeb6db268b6bdc12b226f3fbd45c2f0175c2c82
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -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, |