Merge "Add ServiceManager.registerForNotifications" am: ce80de5db0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1883550 Change-Id: I65215f414aced825be29e036c378057d9c861138
This commit is contained in:
@@ -297,6 +297,17 @@ public final class ServiceManager {
|
|||||||
return isDeclared(name) ? waitForService(name) : null;
|
return isDeclared(name) ? waitForService(name) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 a list of all currently running services.
|
||||||
* @return an array of all currently running services, or <code>null</code> in
|
* @return an array of all currently running services, or <code>null</code> in
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ class ServiceManagerProxy implements IServiceManager {
|
|||||||
|
|
||||||
public void registerForNotifications(String name, IServiceCallback cb)
|
public void registerForNotifications(String name, IServiceCallback cb)
|
||||||
throws RemoteException {
|
throws RemoteException {
|
||||||
throw new RemoteException();
|
mServiceManager.registerForNotifications(name, cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void unregisterForNotifications(String name, IServiceCallback cb)
|
public void unregisterForNotifications(String name, IServiceCallback cb)
|
||||||
|
|||||||
Reference in New Issue
Block a user