Initial InputMappers for evdev input HAL.
The previous design of the InputHost wrapper classes made it very
painful to do testing, so this change also reverts to a more classical
C++ pattern for non-copyable objects. The InputHost classes still simply
call through to the input_host_t and callbacks as before.
Updated unittests to use gmock for mocking the InputHost interactions.
Change-Id: I4b70df2c89ed48af77446b8f5b87a4bde94510bf
diff --git a/modules/input/evdev/InputDeviceManager.h b/modules/input/evdev/InputDeviceManager.h
index 25dd912..7ffec5b 100644
--- a/modules/input/evdev/InputDeviceManager.h
+++ b/modules/input/evdev/InputDeviceManager.h
@@ -35,7 +35,7 @@
*/
class InputDeviceManager : public InputCallbackInterface {
public:
- explicit InputDeviceManager(InputHost host) :
+ explicit InputDeviceManager(InputHostInterface* host) :
mHost(host) {}
virtual ~InputDeviceManager() override = default;
@@ -45,7 +45,7 @@
virtual void onDeviceRemoved(const std::shared_ptr<InputDeviceNode>& node) override;
private:
- InputHost mHost;
+ InputHostInterface* mHost;
template<class T, class U>
using DeviceMap = std::unordered_map<std::shared_ptr<T>, std::shared_ptr<U>>;