1 /* 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 17 #pragma once 18 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 28 namespace android { 29 30 class InputDriverInterface; 31 32 class InputHostInterface : public virtual RefBase { 33 protected: 34 InputHostInterface() = default; 35 virtual ~InputHostInterface() = default; 36 37 public: 38 39 virtual void registerInputDriver(InputDriverInterface* driver) = 0; 40 41 virtual void dump(String8& result) = 0; 42 }; 43 44 class InputHost : public InputHostInterface { 45 public: 46 InputHost() = default; 47 48 virtual void registerInputDriver(InputDriverInterface* driver) override; 49 50 virtual void dump(String8& result) override; 51 52 private: 53 std::vector<sp<InputDriverInterface>> mDrivers; 54 }; 55 56 } // namespace android 57