blob: 2d4fbaee241d872c0c16c117487c65380ac0e3b6 [file] [log] [blame]
Brian Duddiea7bf0d22020-02-14 14:24:39 -08001/*
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#include "Contexthub.h"
17
18#include <vector>
19
20namespace android {
21namespace hardware {
22namespace contexthub {
23namespace V1_1 {
24namespace implementation {
25
Anthony Stange100aa5e2020-12-17 14:20:02 -050026using ::android::hardware::contexthub::V1_0::Result;
27
Brian Duddiea7bf0d22020-02-14 14:24:39 -080028Return<void> Contexthub::onSettingChanged(Setting /*setting*/, SettingValue /*newValue*/) {
29 return Void();
30}
31
Anthony Stange100aa5e2020-12-17 14:20:02 -050032Return<Result> Contexthub::registerCallback(uint32_t hubId, const sp<IContexthubCallback>& cb) {
33 if (hubId == kMockHubId) {
34 mCallback = cb;
35 return Result::OK;
36 }
37 return Result::BAD_PARAMS;
38}
39
40Return<Result> Contexthub::queryApps(uint32_t hubId) {
41 if (hubId == kMockHubId && mCallback != nullptr) {
42 std::vector<HubAppInfo> nanoapps;
43 mCallback->handleAppsInfo(nanoapps);
44 return Result::OK;
45 }
46 return Result::BAD_PARAMS;
47}
48
Brian Duddiea7bf0d22020-02-14 14:24:39 -080049} // namespace implementation
50} // namespace V1_1
51} // namespace contexthub
52} // namespace hardware
53} // namespace android