Merge "ServiceManager: add getDeclaredInstances" am: 9ff2444ba7 am: b1b830369e am: 7ceee368ee
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1436518 Change-Id: I7755509b329914c491a205f843e731694b02ce84
This commit is contained in:
@@ -234,6 +234,21 @@ public final class ServiceManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the list of declared instances for an interface.
|
||||
*
|
||||
* @return true if the service is declared somewhere (eg. VINTF manifest) and
|
||||
* waitForService should always be able to return the service.
|
||||
*/
|
||||
public static String[] getDeclaredInstances(@NonNull String iface) {
|
||||
try {
|
||||
return getIServiceManager().getDeclaredInstances(iface);
|
||||
} catch (RemoteException e) {
|
||||
Log.e(TAG, "error in getDeclaredInstances", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the specified service from the service manager.
|
||||
*
|
||||
|
||||
@@ -90,6 +90,10 @@ class ServiceManagerProxy implements IServiceManager {
|
||||
return mServiceManager.isDeclared(name);
|
||||
}
|
||||
|
||||
public String[] getDeclaredInstances(String iface) throws RemoteException {
|
||||
return mServiceManager.getDeclaredInstances(iface);
|
||||
}
|
||||
|
||||
public void registerClientCallback(String name, IBinder service, IClientCallback cb)
|
||||
throws RemoteException {
|
||||
throw new RemoteException();
|
||||
|
||||
Reference in New Issue
Block a user