blob: 976fca43365536277924e4e3cd9c3f4584a282ec [file] [log] [blame]
Steven Moreland5d5ef7f2016-10-20 19:19:55 -07001/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.hidl.manager@1.0;
18
Steven Morelandf1d03c72016-11-08 16:00:45 -080019/**
20 * Manages all the hidl hals on a device.
21 *
22 * All examples in this file assume that there is one service registered with
23 * the service manager, "android.hidl.manager@1.0::IServiceManager/manager"
24 *
25 * Terminology:
26 * Package: "android.hidl.manager"
27 * Major version: "1"
28 * Minor version: "0"
29 * Version: "1.0"
30 * Interface name: "IServiceManager"
31 * Fully-qualified interface name: "android.hidl.manager@1.0::IServiceManager"
32 * Instance name: "manager"
33 * Fully-qualified instance name: "android.hidl.manager@1.0::IServiceManager/manager"
34 */
Steven Moreland5d5ef7f2016-10-20 19:19:55 -070035interface IServiceManager {
Steven Moreland5d5ef7f2016-10-20 19:19:55 -070036
37 /**
38 * Retrieve an existing service.
39 *
Steven Morelandf0cc0972016-11-02 17:51:46 -070040 * WARNING: This function is for libhidl/HwBinder use only. You are likely
41 * looking for 'IMyInterface::getService("name")' instead.
42 *
43 * @param iface Fully-qualified interface name.
Steven Morelandf1d03c72016-11-08 16:00:45 -080044 * @param name Instance name. Same as in IServiceManager::add.
Steven Morelandf0cc0972016-11-02 17:51:46 -070045 *
46 * @return service Handle to requested service, same as provided in
47 * IServiceManager::add.
Steven Moreland5d5ef7f2016-10-20 19:19:55 -070048 */
Steven Morelandf0cc0972016-11-02 17:51:46 -070049 get(string fqName, string name) generates (interface service);
Steven Moreland5d5ef7f2016-10-20 19:19:55 -070050
51 /**
52 * Register a service.
53 *
Steven Morelandf0cc0972016-11-02 17:51:46 -070054 * WARNING: This function is for libhidl/HwBinder use only. You are likely
55 * looking for 'INTERFACE::registerAsService("name")' instead.
Steven Moreland5d5ef7f2016-10-20 19:19:55 -070056 *
Steven Morelandf0cc0972016-11-02 17:51:46 -070057 * @param interfaceChain List of fully-qualified interface names. The first
58 * must be the actual interface name. Subsequent names must
59 * follow the inheritance hierarchy of the interface.
Steven Morelandf1d03c72016-11-08 16:00:45 -080060 * @param name Instance name. Must also be used to retrieve service.
Steven Morelandf0cc0972016-11-02 17:51:46 -070061 * @param service Handle to registering service.
62 *
63 * @return success Whether or not the service was registered.
64 *
Steven Moreland5d5ef7f2016-10-20 19:19:55 -070065 */
Steven Morelandf0cc0972016-11-02 17:51:46 -070066 add(vec<string> interfaceChain, string name, interface service)
67 generates (bool success);
Steven Moreland5d5ef7f2016-10-20 19:19:55 -070068
Steven Morelandf1d03c72016-11-08 16:00:45 -080069 /**
70 * List all registered services.
71 *
72 * @return fqInstanceNames List of fully-qualified instance names.
73 */
74 list() generates (vec<string> fqInstanceNames);
75
76 /**
77 * List all instances of a particular service.
78 *
79 * @param fqName Fully-qualified interface name.
80 *
81 * @return instanceNames List of instance names running the particular service.
82 */
83 listByInterface(string fqName) generates (vec<string> instanceNames);
84
Steven Moreland5d5ef7f2016-10-20 19:19:55 -070085};