Change InputReporter to InputReporterInterface
This CL changes InputReporter.h to InputReporterInterface.h to follow the
convention established with InputReader. InputReporterInterface will act
as an interface instead of a class definition, consiting only of pure
virtual methods. This makes libinputreporter more closely analogous to
libinputreader than before.
The new class, InputReporter which extends InputReporterInterface is
defined in its cpp file, InputReporter.cpp.
Bug: 119312287
Test: Build, test touch input
Change-Id: I05eb71ccec9303bd5c240e4571116f7347cafe0a
diff --git a/services/inputflinger/InputReporter.cpp b/services/inputflinger/InputReporter.cpp
index cf4220f..8d3153c 100644
--- a/services/inputflinger/InputReporter.cpp
+++ b/services/inputflinger/InputReporter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2018 The Android Open Source Project
+ * Copyright (C) 2019 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,12 +14,18 @@
* limitations under the License.
*/
-#include "InputReporter.h"
+#include "InputReporterInterface.h"
namespace android {
// --- InputReporter ---
+class InputReporter : public InputReporterInterface {
+public:
+ void reportUnhandledKey(uint32_t sequenceNum) override;
+ void reportDroppedKey(uint32_t sequenceNum) override;
+};
+
void InputReporter::reportUnhandledKey(uint32_t sequenceNum) {
// do nothing
}
@@ -28,7 +34,7 @@
// do nothing
}
-sp<InputReporter> createInputReporter() {
+sp<InputReporterInterface> createInputReporter() {
return new InputReporter();
}