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 | |
| 19 | interface IServiceManager { |
Steven Moreland | 5d5ef7f | 2016-10-20 19:19:55 -0700 | [diff] [blame] | 20 | |
| 21 | /** |
| 22 | * Retrieve an existing service. |
| 23 | * |
Steven Moreland | f0cc097 | 2016-11-02 17:51:46 -0700 | [diff] [blame^] | 24 | * WARNING: This function is for libhidl/HwBinder use only. You are likely |
| 25 | * looking for 'IMyInterface::getService("name")' instead. |
| 26 | * |
| 27 | * @param iface Fully-qualified interface name. |
| 28 | * e.x. "android.hidl.manager@1.0::IServiceManager" |
| 29 | * @param name Name of the specific instance of the service. Same as |
| 30 | * name in IServiceManager::add. e.x. "manager" |
| 31 | * |
| 32 | * @return service Handle to requested service, same as provided in |
| 33 | * IServiceManager::add. |
Steven Moreland | 5d5ef7f | 2016-10-20 19:19:55 -0700 | [diff] [blame] | 34 | */ |
Steven Moreland | f0cc097 | 2016-11-02 17:51:46 -0700 | [diff] [blame^] | 35 | get(string fqName, string name) generates (interface service); |
Steven Moreland | 5d5ef7f | 2016-10-20 19:19:55 -0700 | [diff] [blame] | 36 | |
| 37 | /** |
| 38 | * Register a 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 'INTERFACE::registerAsService("name")' instead. |
Steven Moreland | 5d5ef7f | 2016-10-20 19:19:55 -0700 | [diff] [blame] | 42 | * |
Steven Moreland | f0cc097 | 2016-11-02 17:51:46 -0700 | [diff] [blame^] | 43 | * @param interfaceChain List of fully-qualified interface names. The first |
| 44 | * must be the actual interface name. Subsequent names must |
| 45 | * follow the inheritance hierarchy of the interface. |
| 46 | * @param name Can be anything. Must also be used to retrieve service. |
| 47 | * @param service Handle to registering service. |
| 48 | * |
| 49 | * @return success Whether or not the service was registered. |
| 50 | * |
Steven Moreland | 5d5ef7f | 2016-10-20 19:19:55 -0700 | [diff] [blame] | 51 | */ |
Steven Moreland | f0cc097 | 2016-11-02 17:51:46 -0700 | [diff] [blame^] | 52 | add(vec<string> interfaceChain, string name, interface service) |
| 53 | generates (bool success); |
Steven Moreland | 5d5ef7f | 2016-10-20 19:19:55 -0700 | [diff] [blame] | 54 | |
| 55 | }; |