Loading services/inputflinger/Android.bp +9 −56 Original line number Diff line number Diff line Loading @@ -30,7 +30,6 @@ cc_library_shared { srcs: [ "InputClassifier.cpp", "InputClassifierConverter.cpp", "InputDispatcher.cpp", "InputManager.cpp", ], Loading @@ -50,6 +49,10 @@ cc_library_shared { "server_configurable_flags", ], static_libs: [ "libinputdispatcher", ], cflags: [ // TODO(b/23084678): Move inputflinger to its own process and mark it hidden //-fvisibility=hidden Loading @@ -60,44 +63,16 @@ cc_library_shared { "include", ], export_static_lib_headers: [ "libinputdispatcher", ], } cc_library_headers { name: "libinputflinger_headers", header_libs: ["libinputreporter_headers"], export_include_dirs: ["include"], } cc_library_shared { name: "libinputreader", defaults: ["inputflinger_defaults"], srcs: [ "EventHub.cpp", "InputReader.cpp", "InputReaderFactory.cpp", "TouchVideoDevice.cpp", ], shared_libs: [ "libbase", "libinputflinger_base", "libcrypto", "libcutils", "libinput", "liblog", "libui", "libutils", "libhardware_legacy", "libstatslog", ], header_libs: [ "libinputflinger_headers", ], export_header_lib_headers: [ "libinputflinger_headers", ], export_header_lib_headers: ["libinputreporter_headers"], } cc_library_shared { Loading Loading @@ -125,28 +100,6 @@ cc_library_shared { ], } 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", Loading services/inputflinger/InputManager.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ //#define LOG_NDEBUG 0 #include "InputManager.h" #include "InputDispatcherFactory.h" #include "InputDispatcherThread.h" #include "InputReaderFactory.h" #include <binder/IPCThreadState.h> Loading @@ -33,7 +35,7 @@ namespace android { InputManager::InputManager( const sp<InputReaderPolicyInterface>& readerPolicy, const sp<InputDispatcherPolicyInterface>& dispatcherPolicy) { mDispatcher = new InputDispatcher(dispatcherPolicy); mDispatcher = createInputDispatcher(dispatcherPolicy); mClassifier = new InputClassifier(mDispatcher); mReader = createInputReader(readerPolicy, mClassifier); initialize(); Loading services/inputflinger/InputManager.h +5 −5 Original line number Diff line number Diff line Loading @@ -21,15 +21,14 @@ * Native input manager. */ #include "EventHub.h" #include "InputReaderBase.h" #include "InputClassifier.h" #include "InputDispatcher.h" #include "InputReader.h" #include "InputReaderBase.h" #include <InputDispatcherInterface.h> #include <InputDispatcherPolicyInterface.h> #include <input/ISetInputWindowsListener.h> #include <input/Input.h> #include <input/InputTransport.h> #include <input/ISetInputWindowsListener.h> #include <input/IInputFlinger.h> #include <utils/Errors.h> Loading @@ -39,6 +38,7 @@ namespace android { class InputChannel; class InputDispatcherThread; /* * The input manager is the core of the system event processing. Loading services/inputflinger/dispatcher/Android.bp 0 → 100644 +42 −0 Original line number Diff line number Diff line // 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. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. cc_library_static { name: "libinputdispatcher", defaults: ["inputflinger_defaults"], srcs: [ "Connection.cpp", "Entry.cpp", "InjectionState.cpp", "InputDispatcher.cpp", "InputDispatcherFactory.cpp", "InputDispatcherThread.cpp", "InputState.cpp", "InputTarget.cpp", "Monitor.cpp", "TouchState.cpp" ], shared_libs: [ "libbase", "libcutils", "libinput", "libinputreporter", "libinputflinger_base", "liblog", "libui", "libutils", ], export_include_dirs: ["include"], } services/inputflinger/dispatcher/CancelationOptions.h 0 → 100644 +53 −0 Original line number Diff line number Diff line /* * 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. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _UI_INPUT_INPUTDISPATCHER_CANCELLATIONOPTIONS_H #define _UI_INPUT_INPUTDISPATCHER_CANCELLATIONOPTIONS_H #include <optional> namespace android::inputdispatcher { /* Specifies which events are to be canceled and why. */ struct CancelationOptions { enum Mode { CANCEL_ALL_EVENTS = 0, CANCEL_POINTER_EVENTS = 1, CANCEL_NON_POINTER_EVENTS = 2, CANCEL_FALLBACK_EVENTS = 3, }; // The criterion to use to determine which events should be canceled. Mode mode; // Descriptive reason for the cancelation. const char* reason; // The specific keycode of the key event to cancel, or nullopt to cancel any key event. std::optional<int32_t> keyCode = std::nullopt; // The specific device id of events to cancel, or nullopt to cancel events from any device. std::optional<int32_t> deviceId = std::nullopt; // The specific display id of events to cancel, or nullopt to cancel events on any display. std::optional<int32_t> displayId = std::nullopt; CancelationOptions(Mode mode, const char* reason) : mode(mode), reason(reason) {} }; } // namespace android::inputdispatcher #endif // _UI_INPUT_INPUTDISPATCHER_CANCELLATIONOPTIONS_H Loading
services/inputflinger/Android.bp +9 −56 Original line number Diff line number Diff line Loading @@ -30,7 +30,6 @@ cc_library_shared { srcs: [ "InputClassifier.cpp", "InputClassifierConverter.cpp", "InputDispatcher.cpp", "InputManager.cpp", ], Loading @@ -50,6 +49,10 @@ cc_library_shared { "server_configurable_flags", ], static_libs: [ "libinputdispatcher", ], cflags: [ // TODO(b/23084678): Move inputflinger to its own process and mark it hidden //-fvisibility=hidden Loading @@ -60,44 +63,16 @@ cc_library_shared { "include", ], export_static_lib_headers: [ "libinputdispatcher", ], } cc_library_headers { name: "libinputflinger_headers", header_libs: ["libinputreporter_headers"], export_include_dirs: ["include"], } cc_library_shared { name: "libinputreader", defaults: ["inputflinger_defaults"], srcs: [ "EventHub.cpp", "InputReader.cpp", "InputReaderFactory.cpp", "TouchVideoDevice.cpp", ], shared_libs: [ "libbase", "libinputflinger_base", "libcrypto", "libcutils", "libinput", "liblog", "libui", "libutils", "libhardware_legacy", "libstatslog", ], header_libs: [ "libinputflinger_headers", ], export_header_lib_headers: [ "libinputflinger_headers", ], export_header_lib_headers: ["libinputreporter_headers"], } cc_library_shared { Loading Loading @@ -125,28 +100,6 @@ cc_library_shared { ], } 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", Loading
services/inputflinger/InputManager.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ //#define LOG_NDEBUG 0 #include "InputManager.h" #include "InputDispatcherFactory.h" #include "InputDispatcherThread.h" #include "InputReaderFactory.h" #include <binder/IPCThreadState.h> Loading @@ -33,7 +35,7 @@ namespace android { InputManager::InputManager( const sp<InputReaderPolicyInterface>& readerPolicy, const sp<InputDispatcherPolicyInterface>& dispatcherPolicy) { mDispatcher = new InputDispatcher(dispatcherPolicy); mDispatcher = createInputDispatcher(dispatcherPolicy); mClassifier = new InputClassifier(mDispatcher); mReader = createInputReader(readerPolicy, mClassifier); initialize(); Loading
services/inputflinger/InputManager.h +5 −5 Original line number Diff line number Diff line Loading @@ -21,15 +21,14 @@ * Native input manager. */ #include "EventHub.h" #include "InputReaderBase.h" #include "InputClassifier.h" #include "InputDispatcher.h" #include "InputReader.h" #include "InputReaderBase.h" #include <InputDispatcherInterface.h> #include <InputDispatcherPolicyInterface.h> #include <input/ISetInputWindowsListener.h> #include <input/Input.h> #include <input/InputTransport.h> #include <input/ISetInputWindowsListener.h> #include <input/IInputFlinger.h> #include <utils/Errors.h> Loading @@ -39,6 +38,7 @@ namespace android { class InputChannel; class InputDispatcherThread; /* * The input manager is the core of the system event processing. Loading
services/inputflinger/dispatcher/Android.bp 0 → 100644 +42 −0 Original line number Diff line number Diff line // 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. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. cc_library_static { name: "libinputdispatcher", defaults: ["inputflinger_defaults"], srcs: [ "Connection.cpp", "Entry.cpp", "InjectionState.cpp", "InputDispatcher.cpp", "InputDispatcherFactory.cpp", "InputDispatcherThread.cpp", "InputState.cpp", "InputTarget.cpp", "Monitor.cpp", "TouchState.cpp" ], shared_libs: [ "libbase", "libcutils", "libinput", "libinputreporter", "libinputflinger_base", "liblog", "libui", "libutils", ], export_include_dirs: ["include"], }
services/inputflinger/dispatcher/CancelationOptions.h 0 → 100644 +53 −0 Original line number Diff line number Diff line /* * 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. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _UI_INPUT_INPUTDISPATCHER_CANCELLATIONOPTIONS_H #define _UI_INPUT_INPUTDISPATCHER_CANCELLATIONOPTIONS_H #include <optional> namespace android::inputdispatcher { /* Specifies which events are to be canceled and why. */ struct CancelationOptions { enum Mode { CANCEL_ALL_EVENTS = 0, CANCEL_POINTER_EVENTS = 1, CANCEL_NON_POINTER_EVENTS = 2, CANCEL_FALLBACK_EVENTS = 3, }; // The criterion to use to determine which events should be canceled. Mode mode; // Descriptive reason for the cancelation. const char* reason; // The specific keycode of the key event to cancel, or nullopt to cancel any key event. std::optional<int32_t> keyCode = std::nullopt; // The specific device id of events to cancel, or nullopt to cancel events from any device. std::optional<int32_t> deviceId = std::nullopt; // The specific display id of events to cancel, or nullopt to cancel events on any display. std::optional<int32_t> displayId = std::nullopt; CancelationOptions(Mode mode, const char* reason) : mode(mode), reason(reason) {} }; } // namespace android::inputdispatcher #endif // _UI_INPUT_INPUTDISPATCHER_CANCELLATIONOPTIONS_H