blob: 3488b7446c2ee0c2891db5636a4675bb27abb9c5 [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 Stangee351e3b2020-12-15 11:06:14 -050019import @1.0::Result;
Arthur Ishiguro08596b42020-09-30 10:48:36 -070020import @1.1::IContexthub;
21import @1.1::SettingValue;
Anthony Stangee351e3b2020-12-15 11:06:14 -050022import IContexthubCallback;
Arthur Ishiguro08596b42020-09-30 10:48:36 -070023
24interface IContexthub extends @1.1::IContexthub {
25 /**
Anthony Stangee351e3b2020-12-15 11:06:14 -050026 * Register a callback for the HAL implementation to send asynchronous
27 * messages to the service from a context hub. There can be a maximum of
28 * one callback registered with the HAL. A call to this function when a
29 * callback has already been registered must override the previous
30 * registration.
31 *
32 * @param hubId identifier for the hub
33 * @param callback an implementation of the IContextHubCallbacks
34 *
35 * @return result OK on success
36 * BAD_VALUE if parameters are not valid
37 *
38 */
39 registerCallback_1_2(uint32_t hubId, IContexthubCallback cb) generates (Result result);
40
41 /**
42 * Send a message to a hub
43 *
44 * @param hubId identifier for hub to send message to
45 * @param msg message to be sent
46 *
47 * @return result OK if successful, error code otherwise
48 * BAD_VALUE if parameters are not valid
49 * TRANSACTION_FAILED if message send failed
50 */
51 sendMessageToHub_1_2(uint32_t hubId, ContextHubMsg msg) 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};