Package: android.hidl.manager@1.0

IServiceManager

interface IServiceManager

Manages all the hidl hals on a device.

All examples in this file assume that there is one service registered with the service manager, "android.hidl.manager@1.0::IServiceManager/manager"

Terminology:Package:"android.hidl.manager" Major version:"1" Minor version:"0" Version:"1.0" Interface name:"IServiceManager" Fully-qualified interface name:"android.hidl.manager@1.0::IServiceManager" Instance name:"manager" Fully-qualified instance name:"android.hidl.manager@1.0::IServiceManager/manager"

Properties

Transport

enum Transport: uint8_t
Details
Members
EMPTY
HWBINDER
PASSTHROUGH

PidConstant

enum PidConstant: int32_t

Special values for InstanceDebugInfo pids.

Details
Members
NO_PID = -1

InstanceDebugInfo

struct InstanceDebugInfo {string interfaceName; string instanceName; int32_t pid; vec clientPids; Architecture arch}

Returned object for debugDump().

Details
Members
interfaceName
instanceName
pid
clientPids
arch

Methods

get

get (string fqName, string name)
generates (/***/interface service)

Retrieve an existing service that supports the requested version.

WARNING:This function is for libhidl/HwBinder use only.You are likely looking for 'IMyInterface::getService("name")' instead.

Details
Parameters
fqName
name
Instance name.Same as in IServiceManager::add.
Generates
service
Handle to requested service, same as provided in IServiceManager::add.Will be nullptr if not available.

add

add (string name, /***/interface service)
generates (bool success)

Register a service.The service manager must retrieve the(inherited)interfaces that this service implements, and register them along with the service.

Each interface must have its own namespace for instance names.If you have two unrelated interfaces IFoo and IBar, it must be valid to call:

add("my_instance", foo);//foo implements IFoo add("my_instance", bar);//bar implements IBar

WARNING:This function is for libhidl/HwBinder use only.You are likely looking for 'INTERFACE::registerAsService("name")' instead.

Details
Parameters
name
Instance name.Must also be used to retrieve service.
service
Handle to registering service.
Generates
success
Whether or not the service was registered.

getTransport

getTransport (string fqName, string name)
generates (Transport transport)

Get the transport of a service.

Details
Parameters
fqName
Fully-qualified interface name.
name
Instance name.Same as in IServiceManager::add
Generates
transport
Transport of service if known.

list

list ()
generates (vec<string> fqInstanceNames)

List all registered services.Must be sorted.

Details
Generates
fqInstanceNames
List of fully-qualified instance names.

listByInterface

listByInterface (string fqName)
generates (vec<string> instanceNames)

List all instances of a particular service.Must be sorted.

Details
Parameters
fqName
Fully-qualified interface name.
Generates
instanceNames
List of instance names running the particular service.

registerForNotifications

registerForNotifications (string fqName, string name, IServiceNotification callback)
generates (bool success)

Register for service notifications for a particular service.Must support multiple registrations.

onRegistration must be sent out for all services which support the version provided in the fqName.For instance, if a client registers for notifications from "android.hardware.foo@1.0", they must also get notifications from "android.hardware.foo@1.1".If a matching service is already registered, onRegistration must be sent out with preexisting = true.

Details
Parameters
fqName
Fully-qualified interface name.
name
Instance name.If name is empty, notifications must be sent out for all names.
callback
Client callback to recieve notifications.
Generates
success
Whether or not registration was successful.

debugDump

debugDump ()
generates (vec<InstanceDebugInfo> info)

Similar to list, but contains more information for each instance.

Details
Generates
info
a vector where each item contains debug information for each instance.

registerPassthroughClient

registerPassthroughClient (string fqName, string name)

When the passthrough service manager returns a service via get(string, string), it must dispatch a registerPassthroughClient call to the binderized service manager to indicate the current process has called get().Binderized service manager must record this PID, which can be retrieved via debugDump.

Details
Parameters
fqName
name