blob: 30be0234729ed3d8495f553a2ef3ee2e968cd7e8 [file] [log] [blame]
Yifan Hong2cd440c2016-11-23 11:30:36 -08001/*
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();
Martijn Coenen9b8f9c32016-12-09 15:51:06 +010057
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);
Zhuoyao Zhang5a643b92017-01-03 17:31:53 -080074
75 /*
76 * This method trigger the interface to enable/disable instrumentation based
77 * on system property hal.instrumentation.enable.
78 */
79 oneway setHALInstrumentation();
Yifan Hong2cd440c2016-11-23 11:30:36 -080080};