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 #ifndef ANDROID_HARDWARE_CONTEXTHUB_V1_2_CONTEXTHUB_H
18 #define ANDROID_HARDWARE_CONTEXTHUB_V1_2_CONTEXTHUB_H
19 
20 #include "generic_context_hub_base.h"
21 
22 #include <condition_variable>
23 #include <functional>
24 #include <mutex>
25 #include <optional>
26 
27 #include <android/hardware/contexthub/1.2/IContexthub.h>
28 #include <hidl/MQDescriptor.h>
29 #include <hidl/Status.h>
30 
31 #include "chre_host/fragmented_load_transaction.h"
32 #include "chre_host/host_protocol_host.h"
33 #include "chre_host/socket_client.h"
34 
35 namespace android {
36 namespace hardware {
37 namespace contexthub {
38 namespace V1_2 {
39 namespace implementation {
40 
41 using ::android::hardware::contexthub::common::implementation::
42     GenericContextHubBase;
43 using ::android::hardware::contexthub::V1_0::Result;
44 
45 class GenericContextHubV1_2 : public GenericContextHubBase<V1_2::IContexthub> {
46  public:
47   Return<void> getHubs_1_2(V1_2::IContexthub::getHubs_1_2_cb _hidl_cb) override;
48 
49   Return<Result> registerCallback_1_2(
50       uint32_t hubId, const sp<IContexthubCallback> &cb) override;
51 
52   Return<void> onSettingChanged(V1_1::Setting setting,
53                                 V1_1::SettingValue newValue) override;
54 
55   Return<void> onSettingChanged_1_2(V1_2::Setting setting,
56                                     V1_1::SettingValue newValue) override;
57 };
58 
59 }  // namespace implementation
60 }  // namespace V1_2
61 }  // namespace contexthub
62 }  // namespace hardware
63 }  // namespace android
64 
65 #endif  // ANDROID_HARDWARE_CONTEXTHUB_V1_2_CONTEXTHUB_H
66