Steven Moreland | 5d5ef7f | 2016-10-20 19:19:55 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package android.hidl.manager@1.0; |
| 18 | |
Steven Moreland | f1d03c7 | 2016-11-08 16:00:45 -0800 | [diff] [blame^] | 19 | /** |
| 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 Moreland | 5d5ef7f | 2016-10-20 19:19:55 -0700 | [diff] [blame] | 35 | interface IServiceManager { |
Steven Moreland | 5d5ef7f | 2016-10-20 19:19:55 -0700 | [diff] [blame] | 36 | |
| 37 | /** |
| 38 | * Retrieve an existing service. |
| 39 | * |
Steven Moreland | f0cc097 | 2016-11-02 17:51:46 -0700 | [diff] [blame] | 40 | * 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 Moreland | f1d03c7 | 2016-11-08 16:00:45 -0800 | [diff] [blame^] | 44 | * @param name Instance name. Same as in IServiceManager::add. |
Steven Moreland | f0cc097 | 2016-11-02 17:51:46 -0700 | [diff] [blame] | 45 | * |
| 46 | * @return service Handle to requested service, same as provided in |
| 47 | * IServiceManager::add. |
Steven Moreland | 5d5ef7f | 2016-10-20 19:19:55 -0700 | [diff] [blame] | 48 | */ |
Steven Moreland | f0cc097 | 2016-11-02 17:51:46 -0700 | [diff] [blame] | 49 | get(string fqName, string name) generates (interface service); |
Steven Moreland | 5d5ef7f | 2016-10-20 19:19:55 -0700 | [diff] [blame] | 50 | |
| 51 | /** |
| 52 | * Register a service. |
| 53 | * |
Steven Moreland | f0cc097 | 2016-11-02 17:51:46 -0700 | [diff] [blame] | 54 | * WARNING: This function is for libhidl/HwBinder use only. You are likely |
| 55 | * looking for 'INTERFACE::registerAsService("name")' instead. |
Steven Moreland | 5d5ef7f | 2016-10-20 19:19:55 -0700 | [diff] [blame] | 56 | * |
Steven Moreland | f0cc097 | 2016-11-02 17:51:46 -0700 | [diff] [blame] | 57 | * @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 Moreland | f1d03c7 | 2016-11-08 16:00:45 -0800 | [diff] [blame^] | 60 | * @param name Instance name. Must also be used to retrieve service. |
Steven Moreland | f0cc097 | 2016-11-02 17:51:46 -0700 | [diff] [blame] | 61 | * @param service Handle to registering service. |
| 62 | * |
| 63 | * @return success Whether or not the service was registered. |
| 64 | * |
Steven Moreland | 5d5ef7f | 2016-10-20 19:19:55 -0700 | [diff] [blame] | 65 | */ |
Steven Moreland | f0cc097 | 2016-11-02 17:51:46 -0700 | [diff] [blame] | 66 | add(vec<string> interfaceChain, string name, interface service) |
| 67 | generates (bool success); |
Steven Moreland | 5d5ef7f | 2016-10-20 19:19:55 -0700 | [diff] [blame] | 68 | |
Steven Moreland | f1d03c7 | 2016-11-08 16:00:45 -0800 | [diff] [blame^] | 69 | /** |
| 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 Moreland | 5d5ef7f | 2016-10-20 19:19:55 -0700 | [diff] [blame] | 85 | }; |