summaryrefslogtreecommitdiff
path: root/core/java/android/os/ServiceManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android/os/ServiceManager.java')
-rw-r--r--core/java/android/os/ServiceManager.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/java/android/os/ServiceManager.java b/core/java/android/os/ServiceManager.java
index f853e67f87d0..f7d7b21cb598 100644
--- a/core/java/android/os/ServiceManager.java
+++ b/core/java/android/os/ServiceManager.java
@@ -257,7 +257,12 @@ public final class ServiceManager {
*
* @return {@code null} only if there are permission problems or fatal errors.
*/
- public static native IBinder waitForService(@NonNull String name);
+ public static IBinder waitForService(@NonNull String name) {
+ return Binder.allowBlocking(waitForServiceNative(name));
+ }
+
+ private static native IBinder waitForServiceNative(@NonNull String name);
+
/**
* Returns the specified service from the service manager, if declared.