blob: 305544d5f47d477b834eb16963bbd72c109a2f8c [file] [log] [blame]
Arthur Ishiguro46c2bd02020-10-06 11:05:17 -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#pragma once
17
18#include "ContextHub.h"
Anthony Stange100aa5e2020-12-17 14:20:02 -050019#include "IContextHubCallbackWrapper.h"
Arthur Ishiguro46c2bd02020-10-06 11:05:17 -070020
21#include <android/hardware/contexthub/1.2/IContexthub.h>
22
23namespace android {
24namespace hardware {
25namespace contexthub {
26namespace V1_2 {
27namespace implementation {
28
29class Contexthub
30 : public ::android::hardware::contexthub::V1_X::implementation::ContextHub<IContexthub> {
Anthony Stange6c77c352020-12-16 12:50:08 -050031 using ContextHubMsg = ::android::hardware::contexthub::V1_2::ContextHubMsg;
32 using IContexthubCallback = ::android::hardware::contexthub::V1_2::IContexthubCallback;
Anthony Stange100aa5e2020-12-17 14:20:02 -050033 using IContextHubCallbackWrapperBase =
34 ::android::hardware::contexthub::V1_X::implementation::IContextHubCallbackWrapperBase;
Anthony Stange6c77c352020-12-16 12:50:08 -050035 using Result = ::android::hardware::contexthub::V1_0::Result;
Arthur Ishiguro46c2bd02020-10-06 11:05:17 -070036 using SettingValue = ::android::hardware::contexthub::V1_1::SettingValue;
37 using SettingV1_1 = ::android::hardware::contexthub::V1_1::Setting;
Anthony Stangec3c59b32021-02-10 15:42:10 +000038 using getHubs_1_2_cb = ::android::hardware::contexthub::V1_2::IContexthub::getHubs_1_2_cb;
Arthur Ishiguro46c2bd02020-10-06 11:05:17 -070039
40 public:
Anthony Stange100aa5e2020-12-17 14:20:02 -050041 // Methods from V1_0::IContexthub
42 Return<Result> registerCallback(uint32_t hubId,
43 const sp<V1_0::IContexthubCallback>& cb) override;
Anthony Stange6c77c352020-12-16 12:50:08 -050044
Anthony Stange100aa5e2020-12-17 14:20:02 -050045 Return<Result> queryApps(uint32_t hubId) override;
Anthony Stange6c77c352020-12-16 12:50:08 -050046
Arthur Ishiguro46c2bd02020-10-06 11:05:17 -070047 // Methods from V1_1::IContexthub
48 Return<void> onSettingChanged(SettingV1_1 setting, SettingValue newValue) override;
49
50 // Methods from V1_2::IContexthub
Anthony Stangec3c59b32021-02-10 15:42:10 +000051 Return<void> getHubs_1_2(getHubs_1_2_cb _hidl_cb) override;
52
Arthur Ishiguro46c2bd02020-10-06 11:05:17 -070053 Return<void> onSettingChanged_1_2(Setting setting, SettingValue newValue) override;
Anthony Stange100aa5e2020-12-17 14:20:02 -050054
55 Return<Result> registerCallback_1_2(uint32_t hubId,
56 const sp<V1_2::IContexthubCallback>& cb) override;
57
Anthony Stange100aa5e2020-12-17 14:20:02 -050058 private:
59 sp<IContextHubCallbackWrapperBase> mCallback;
Arthur Ishiguro46c2bd02020-10-06 11:05:17 -070060};
61
62} // namespace implementation
63} // namespace V1_2
64} // namespace contexthub
65} // namespace hardware
66} // namespace android