Divide InputDispatcher into several files.

This CL does:
1) Isolate implementation details of InputDispatcher from outside and
only expose necessary header files;
2) Move implementation details into android::inputdispatcher namespace;
3) Make input dispatcher a static library for inputflinger to link
against;
4) Add InputDispatcherFactory.{h,cpp} to isolate implementation details
in InputDispatcher.h from InputManager.

Bug: 140139676
Test: Mouse clicks can be dispatched to right windows.
Change-Id: Ib61c16fd41f3f76f538a3de9b54f31ac304e03a5
Merged-In: Ib61c16fd41f3f76f538a3de9b54f31ac304e03a5
diff --git a/services/inputflinger/Android.bp b/services/inputflinger/Android.bp
index 8a62a0c..7c24964 100644
--- a/services/inputflinger/Android.bp
+++ b/services/inputflinger/Android.bp
@@ -30,7 +30,6 @@
     srcs: [
         "InputClassifier.cpp",
         "InputClassifierConverter.cpp",
-        "dispatcher/InputDispatcher.cpp",
         "InputManager.cpp",
     ],
 
@@ -50,6 +49,10 @@
         "server_configurable_flags",
     ],
 
+    static_libs: [
+        "libinputdispatcher",
+    ],
+
     cflags: [
         // TODO(b/23084678): Move inputflinger to its own process and mark it hidden
         //-fvisibility=hidden
@@ -58,14 +61,18 @@
     export_include_dirs: [
         ".",
         "include",
-        "dispatcher",
     ],
 
+    export_static_lib_headers: [
+        "libinputdispatcher",
+    ],
 }
 
 cc_library_headers {
     name: "libinputflinger_headers",
+    header_libs: ["libinputreporter_headers"],
     export_include_dirs: ["include"],
+    export_header_lib_headers: ["libinputreporter_headers"],
 }
 
 cc_library_shared {
@@ -126,28 +133,6 @@
     ],
 }
 
-cc_library_shared {
-    name: "libinputreporter",
-    defaults: ["inputflinger_defaults"],
-
-    srcs: [
-        "InputReporter.cpp",
-    ],
-
-    shared_libs: [
-        "liblog",
-        "libutils",
-    ],
-
-    header_libs: [
-        "libinputflinger_headers",
-    ],
-
-    export_header_lib_headers: [
-        "libinputflinger_headers",
-    ],
-}
-
 subdirs = [
     "host",
     "tests",