From ee13e8d435ec3abe821118827226db47e1d7fe53 Mon Sep 17 00:00:00 2001 From: Jiakai Zhang Date: Wed, 25 May 2022 20:05:40 +0100 Subject: [PATCH] Expose ServiceManager.waitForService as system API. ART module needs that method in order to connect to artd. Bug: 233915142 Test: m Change-Id: I3fc487476da8d88238b6974707747b429a132909 --- core/api/module-lib-current.txt | 1 + core/java/android/os/ServiceManager.java | 2 ++ 2 files changed, 3 insertions(+) diff --git a/core/api/module-lib-current.txt b/core/api/module-lib-current.txt index e81d7f1a9fcec..610cb9450c779 100644 --- a/core/api/module-lib-current.txt +++ b/core/api/module-lib-current.txt @@ -358,6 +358,7 @@ package android.os { public final class ServiceManager { method public static boolean isDeclared(@NonNull String); method @Nullable public static android.os.IBinder waitForDeclaredService(@NonNull String); + method @Nullable public static android.os.IBinder waitForService(@NonNull String); } public class StatsServiceManager { diff --git a/core/java/android/os/ServiceManager.java b/core/java/android/os/ServiceManager.java index ba5ed4360cd71..e321a660e8e0b 100644 --- a/core/java/android/os/ServiceManager.java +++ b/core/java/android/os/ServiceManager.java @@ -276,6 +276,8 @@ public final class ServiceManager { * @return {@code null} only if there are permission problems or fatal errors. * @hide */ + @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) + @Nullable public static IBinder waitForService(@NonNull String name) { return Binder.allowBlocking(waitForServiceNative(name)); }