Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0c1abd12 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge changes from topics "inputdispatcher-split-aosp", "inputreader-split-aosp"

* changes:
  Create inputmappers and accumulators directories
  Split InputReader into multiple files
  Create inputreader directory
  Divide InputDispatcher into several files.
  Move InputDispatcher code into a folder.
parents 4f330b8e 394eed02
Loading
Loading
Loading
Loading
+9 −56
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@ cc_library_shared {
    srcs: [
        "InputClassifier.cpp",
        "InputClassifierConverter.cpp",
        "InputDispatcher.cpp",
        "InputManager.cpp",
    ],

@@ -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
@@ -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 {
@@ -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",
+3 −1
Original line number Diff line number Diff line
@@ -19,6 +19,8 @@
//#define LOG_NDEBUG 0

#include "InputManager.h"
#include "InputDispatcherFactory.h"
#include "InputDispatcherThread.h"
#include "InputReaderFactory.h"

#include <binder/IPCThreadState.h>
@@ -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();
+5 −5
Original line number Diff line number Diff line
@@ -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>
@@ -39,6 +38,7 @@

namespace android {
class InputChannel;
class InputDispatcherThread;

/*
 * The input manager is the core of the system event processing.
+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"],
}
+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