IBase.hal revision 9b8f9c38ea8ac1fe1fdf11ea219097885a5f2fa7
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 17package android.hidl.base@1.0; 18 19/* 20 * The ancestor for all interfaces. 21 * 22 * All HAL files will have this interface implicitly imported. If an interface 23 * does not explicitly extend from another interface, it will implicitly extend 24 * from IBase. (This is like java.lang.Object in Java.) 25 * 26 * Methods defined here are shared by all interfaces (this is like 27 * java.lang.Object.notify(), for example.) However, the behavior of these 28 * functions cannot be overridden. 29 */ 30interface IBase { 31 32 /* 33 * Provides run-time type information for this object. 34 * For example, for the following interface definition: 35 * package android.hardware.foo@1.0; 36 * interface IParent {}; 37 * interface IChild {}; 38 * Calling interfaceChain on an IChild object will yield the following: 39 * ["android.hardware.foo@1.0::IChild", 40 * "android.hardware.foo@1.0::IParent" 41 * "android.hidl.base@1.0::IBase"] 42 * 43 * @return indicator a vector of descriptors of the run-time type of the 44 * object. 45 */ 46 interfaceChain() generates (vec<string> indicator); 47 48 /* 49 * This method notifies the interface that one or more system properties 50 * have changed. The default implementation calls 51 * (C++) report_sysprop_change() in libcutils or 52 * (Java) android.os.SystemProperties.reportSyspropChanged, 53 * which in turn calls a set of registered callbacks (eg to update trace 54 * tags). 55 */ 56 oneway notifySyspropsChanged(); 57 58 /* 59 * Registers a death recipient, to be called when the process hosting this 60 * interface dies. 61 * 62 * @param recipient a hidl_death_recipient callback object 63 * @param cookie a cookie that must be returned with the callback 64 * @return success whether the death recipient was registered successfully. 65 */ 66 linkToDeath(death_recipient recipient, uint64_t cookie) generates (bool success); 67 68 /* 69 * Unregisters a previously registered death recipient. 70 * @param recipient a previously registered hidl_death_recipient callback 71 * @return success whether the death recipient was unregistered successfully. 72 */ 73 unlinkToDeath(death_recipient recipient) generates (bool success); 74}; 75