blob: 0dbb61bc3a645364e0cca51261aa316f6b7d03b8 [file] [log] [blame]
Arthur Ishiguroa257b782021-08-04 10:40:29 -07001/*
2 * Copyright (C) 2021 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#pragma once
18
19#include <aidl/android/hardware/contexthub/BnContextHub.h>
20
21namespace aidl {
22namespace android {
23namespace hardware {
24namespace contexthub {
25
26class ContextHub : public BnContextHub {
27 ::ndk::ScopedAStatus getContextHubs(std::vector<ContextHubInfo>* out_contextHubInfos) override;
28 ::ndk::ScopedAStatus loadNanoapp(int32_t in_contextHubId, const NanoappBinary& in_appBinary,
29 int32_t in_transactionId, bool* _aidl_return) override;
30 ::ndk::ScopedAStatus unloadNanoapp(int32_t in_contextHubId, int64_t in_appId,
31 int32_t in_transactionId, bool* _aidl_return) override;
32 ::ndk::ScopedAStatus disableNanoapp(int32_t in_contextHubId, int64_t in_appId,
33 int32_t in_transactionId, bool* _aidl_return) override;
34 ::ndk::ScopedAStatus enableNanoapp(int32_t in_contextHubId, int64_t in_appId,
35 int32_t in_transactionId, bool* _aidl_return) override;
36 ::ndk::ScopedAStatus onSettingChanged(Setting in_setting, bool in_enabled) override;
37 ::ndk::ScopedAStatus queryNanoapps(int32_t in_contextHubId, bool* _aidl_return) override;
38 ::ndk::ScopedAStatus registerCallback(int32_t in_contextHubId,
39 const std::shared_ptr<IContextHubCallback>& in_cb,
40 bool* _aidl_return) override;
41 ::ndk::ScopedAStatus sendMessageToHub(int32_t in_contextHubId,
42 const ContextHubMessage& in_message,
43 bool* _aidl_return) override;
Arthur Ishiguro94e1aa22021-10-26 17:25:19 +000044
45 private:
46 static constexpr uint32_t kMockHubId = 0;
47 std::shared_ptr<IContextHubCallback> mCallback;
Arthur Ishiguroa257b782021-08-04 10:40:29 -070048};
49
50} // namespace contexthub
51} // namespace hardware
52} // namespace android
53} // namespace aidl