aboutsummaryrefslogtreecommitdiff
path: root/host/hal_generic/V1_2/generic_context_hub_v1_2.h
blob: 6f6f41552d07bd1d400978b92450242beb3a3f18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
 * Copyright (C) 2020 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef ANDROID_HARDWARE_CONTEXTHUB_V1_2_CONTEXTHUB_H
#define ANDROID_HARDWARE_CONTEXTHUB_V1_2_CONTEXTHUB_H

#include "generic_context_hub_base.h"

#include <condition_variable>
#include <functional>
#include <mutex>
#include <optional>

#include <android/hardware/contexthub/1.2/IContexthub.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>

#include "chre_host/fragmented_load_transaction.h"
#include "chre_host/host_protocol_host.h"
#include "chre_host/socket_client.h"

namespace android {
namespace hardware {
namespace contexthub {
namespace V1_2 {
namespace implementation {

using ::android::hardware::contexthub::common::implementation::
    GenericContextHubBase;
using ::android::hardware::contexthub::V1_0::Result;

class GenericContextHubV1_2 : public GenericContextHubBase<V1_2::IContexthub> {
 public:
  Return<void> getHubs_1_2(V1_2::IContexthub::getHubs_1_2_cb _hidl_cb) override;

  Return<Result> registerCallback_1_2(
      uint32_t hubId, const sp<IContexthubCallback> &cb) override;

  Return<void> onSettingChanged(V1_1::Setting setting,
                                V1_1::SettingValue newValue) override;

  Return<void> onSettingChanged_1_2(V1_2::Setting setting,
                                    V1_1::SettingValue newValue) override;
};

}  // namespace implementation
}  // namespace V1_2
}  // namespace contexthub
}  // namespace hardware
}  // namespace android

#endif  // ANDROID_HARDWARE_CONTEXTHUB_V1_2_CONTEXTHUB_H