Ashutosh Joshi | 6104b27 | 2016-10-27 11:06:23 -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.hardware.contexthub@1.0; |
| 18 | |
| 19 | interface IContexthubCallback { |
| 20 | /* |
| 21 | * This callback is passed by the Contexthub service to the HAL |
| 22 | * implementation to allow the HAL to send asynchronous messages back |
| 23 | * to the service and registered clients of the ContextHub service. |
| 24 | * |
Ashutosh Joshi | 69e3aa3 | 2016-11-22 14:08:20 -0800 | [diff] [blame^] | 25 | * @params msg : message |
Ashutosh Joshi | 6104b27 | 2016-10-27 11:06:23 -0700 | [diff] [blame] | 26 | * |
| 27 | */ |
Ashutosh Joshi | 69e3aa3 | 2016-11-22 14:08:20 -0800 | [diff] [blame^] | 28 | handleClientMsg(ContextHubMsg msg); |
Ashutosh Joshi | 6104b27 | 2016-10-27 11:06:23 -0700 | [diff] [blame] | 29 | |
| 30 | /* |
| 31 | * This callback is passed by the Contexthub service to the HAL |
| 32 | * implementation to allow the HAL to send the response for a |
| 33 | * transaction. |
| 34 | * |
Ashutosh Joshi | 69e3aa3 | 2016-11-22 14:08:20 -0800 | [diff] [blame^] | 35 | * @params txnId : transaction id whose result is being sent |
Ashutosh Joshi | 6104b27 | 2016-10-27 11:06:23 -0700 | [diff] [blame] | 36 | * passed in by the service at start of transacation. |
| 37 | * result: result of transaction. |
| 38 | * |
| 39 | */ |
Ashutosh Joshi | 69e3aa3 | 2016-11-22 14:08:20 -0800 | [diff] [blame^] | 40 | handleTxnResult(uint32_t txnId, TransactionResult result); |
Ashutosh Joshi | 6104b27 | 2016-10-27 11:06:23 -0700 | [diff] [blame] | 41 | |
| 42 | /* |
| 43 | * This callback is passed by the Contexthub service to the HAL |
| 44 | * implementation to allow the HAL to send an asynchronous event |
| 45 | * to the ContextHub service. |
| 46 | * |
Ashutosh Joshi | 69e3aa3 | 2016-11-22 14:08:20 -0800 | [diff] [blame^] | 47 | * @params msg : message |
Ashutosh Joshi | 6104b27 | 2016-10-27 11:06:23 -0700 | [diff] [blame] | 48 | * |
| 49 | */ |
Ashutosh Joshi | 69e3aa3 | 2016-11-22 14:08:20 -0800 | [diff] [blame^] | 50 | handleHubEvent(AsyncEventType evt); |
Ashutosh Joshi | 6104b27 | 2016-10-27 11:06:23 -0700 | [diff] [blame] | 51 | |
| 52 | /* |
| 53 | * This callback is passed by the Contexthub service to the HAL |
| 54 | * implementation to allow the HAL to send information about the |
| 55 | * currently loaded and active nanoapps on the hub. |
Ashutosh Joshi | 69e3aa3 | 2016-11-22 14:08:20 -0800 | [diff] [blame^] | 56 | * |
| 57 | * @params appInfo : vector of HubAppinfo structure for each nanoApp |
| 58 | * on the hub that can be enabled, disabled and |
| 59 | * unloaded by the service. Any nanoApps that cannot |
| 60 | * be controlled by the service must not be reported. |
| 61 | * All nanoApps that can be controlled by the service |
| 62 | * must be reported. |
Ashutosh Joshi | 6104b27 | 2016-10-27 11:06:23 -0700 | [diff] [blame] | 63 | */ |
Ashutosh Joshi | 69e3aa3 | 2016-11-22 14:08:20 -0800 | [diff] [blame^] | 64 | handleAppsInfo(vec<HubAppInfo> appInfo); |
Ashutosh Joshi | 6104b27 | 2016-10-27 11:06:23 -0700 | [diff] [blame] | 65 | }; |