diff options
| author | 2021-11-17 05:02:35 +0000 | |
|---|---|---|
| committer | 2021-11-17 05:02:35 +0000 | |
| commit | ce80de5db072878cc8e330dc716d411355b48d08 (patch) | |
| tree | 8447ed2841372315cf6740211f74f59e1ec9e20e | |
| parent | 7d0bdd39fdad70b47e4ef1127122c27b4430cbe2 (diff) | |
| parent | 6a2929d6ceaf6d0efd7a4f05d583e9185150b441 (diff) | |
Merge "Add ServiceManager.registerForNotifications"
| -rw-r--r-- | core/java/android/os/ServiceManager.java | 11 | ||||
| -rw-r--r-- | core/java/android/os/ServiceManagerNative.java | 2 |
2 files changed, 12 insertions, 1 deletions
diff --git a/core/java/android/os/ServiceManager.java b/core/java/android/os/ServiceManager.java index 4e8418bd60ec..ba5ed4360cd7 100644 --- a/core/java/android/os/ServiceManager.java +++ b/core/java/android/os/ServiceManager.java @@ -298,6 +298,17 @@ public final class ServiceManager { } /** + * Register callback for service registration notifications. + * + * @throws RemoteException for underlying error. + * @hide + */ + public static void registerForNotifications( + @NonNull String name, @NonNull IServiceCallback callback) throws RemoteException { + getIServiceManager().registerForNotifications(name, callback); + } + + /** * Return a list of all currently running services. * @return an array of all currently running services, or <code>null</code> in * case of an exception diff --git a/core/java/android/os/ServiceManagerNative.java b/core/java/android/os/ServiceManagerNative.java index 3739040eef60..2dcf67483203 100644 --- a/core/java/android/os/ServiceManagerNative.java +++ b/core/java/android/os/ServiceManagerNative.java @@ -78,7 +78,7 @@ class ServiceManagerProxy implements IServiceManager { public void registerForNotifications(String name, IServiceCallback cb) throws RemoteException { - throw new RemoteException(); + mServiceManager.registerForNotifications(name, cb); } public void unregisterForNotifications(String name, IServiceCallback cb) |