Arthur Ishiguro | 08596b4 | 2020-09-30 10:48:36 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package android.hardware.contexthub@1.2; |
| 18 | |
Anthony Stange | 2bdef6a | 2021-02-10 15:11:38 +0000 | [diff] [blame] | 19 | import @1.0::ContextHub; |
Anthony Stange | e351e3b | 2020-12-15 11:06:14 -0500 | [diff] [blame] | 20 | import @1.0::Result; |
Arthur Ishiguro | 08596b4 | 2020-09-30 10:48:36 -0700 | [diff] [blame] | 21 | import @1.1::IContexthub; |
| 22 | import @1.1::SettingValue; |
Anthony Stange | e351e3b | 2020-12-15 11:06:14 -0500 | [diff] [blame] | 23 | import IContexthubCallback; |
Arthur Ishiguro | 08596b4 | 2020-09-30 10:48:36 -0700 | [diff] [blame] | 24 | |
| 25 | interface IContexthub extends @1.1::IContexthub { |
| 26 | /** |
Anthony Stange | 2bdef6a | 2021-02-10 15:11:38 +0000 | [diff] [blame] | 27 | * 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 Stange | e351e3b | 2020-12-15 11:06:14 -0500 | [diff] [blame] | 38 | * 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 Ishiguro | 08596b4 | 2020-09-30 10:48:36 -0700 | [diff] [blame] | 54 | * 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 | }; |