blob: bdc4225738df0b07805386e28ba679e3a0d32a5e [file] [log] [blame]
Michael Wright6f783602015-02-13 17:35:16 -08001/*
2 * Copyright (C) 2015 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
Prabir Pradhan48108662022-09-09 21:22:04 +000017#pragma once
Michael Wright6f783602015-02-13 17:35:16 -080018
19#include <vector>
20
21#include <hardware/input.h>
22#include <utils/RefBase.h>
23#include <utils/String8.h>
24#include <utils/StrongPointer.h>
25
26#include "InputDriver.h"
27
Michael Wright6f783602015-02-13 17:35:16 -080028namespace android {
29
30class InputDriverInterface;
31
Tim Kilbourn2e7f0142015-09-09 16:11:54 -070032class InputHostInterface : public virtual RefBase {
Michael Wright6f783602015-02-13 17:35:16 -080033protected:
34 InputHostInterface() = default;
35 virtual ~InputHostInterface() = default;
36
37public:
38
39 virtual void registerInputDriver(InputDriverInterface* driver) = 0;
40
41 virtual void dump(String8& result) = 0;
42};
43
44class InputHost : public InputHostInterface {
45public:
46 InputHost() = default;
47
48 virtual void registerInputDriver(InputDriverInterface* driver) override;
49
50 virtual void dump(String8& result) override;
51
52private:
53 std::vector<sp<InputDriverInterface>> mDrivers;
54};
55
56} // namespace android