blob: 04a8cb29cc96a51efdc069877b588ed3d3125334 [file] [log] [blame]
Arthur Ishiguro08596b42020-09-30 10:48:36 -07001/*
2 * Copyright (C) 2020 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.hardware.contexthub@1.2;
18
Anthony Stange2bdef6a2021-02-10 15:11:38 +000019import @1.0::ContextHub;
Anthony Stangee351e3b2020-12-15 11:06:14 -050020import @1.0::Result;
Arthur Ishiguro08596b42020-09-30 10:48:36 -070021import @1.1::IContexthub;
22import @1.1::SettingValue;
Anthony Stangee351e3b2020-12-15 11:06:14 -050023import IContexthubCallback;
Arthur Ishiguro08596b42020-09-30 10:48:36 -070024
25interface IContexthub extends @1.1::IContexthub {
26 /**
Anthony Stange2bdef6a2021-02-10 15:11:38 +000027 * Enumerate all available context hubs on the system.
28 *
29 * @return hubs list of hubs on this system.
30 * @return supportedPermissions list of Android permissions all hubs
31 * support for nanoapps to enforce host
32 * endpoints are granted in order to
33 * communicate with them.
34 */
35 getHubs_1_2() generates (vec<ContextHub> hubs, vec<string> supportedPermissions);
36
37 /**
Anthony Stangee351e3b2020-12-15 11:06:14 -050038 * Register a callback for the HAL implementation to send asynchronous
39 * messages to the service from a context hub. There can be a maximum of
40 * one callback registered with the HAL. A call to this function when a
41 * callback has already been registered must override the previous
42 * registration.
43 *
44 * @param hubId identifier for the hub
45 * @param callback an implementation of the IContextHubCallbacks
46 *
47 * @return result OK on success
48 * BAD_VALUE if parameters are not valid
49 *
50 */
51 registerCallback_1_2(uint32_t hubId, IContexthubCallback cb) generates (Result result);
52
53 /**
Arthur Ishiguro08596b42020-09-30 10:48:36 -070054 * Notification sent by the framework to indicate that the user
55 * has changed a setting.
56 *
57 * @param setting User setting that has been modified.
58 * @param newValue The update value of the user setting.
59 */
60 onSettingChanged_1_2(Setting setting, @1.1::SettingValue newValue);
61};