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

Commit d378ca66 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add enabled state to InputDevice and remove isInputDeviceEnabled(2/n)" into main

parents 6e9efeb0 37751084
Loading
Loading
Loading
Loading
+0 −3
Original line number Original line Diff line number Diff line
@@ -310,9 +310,6 @@ public:
    /* Called by the heartbeat to ensures that the reader has not deadlocked. */
    /* Called by the heartbeat to ensures that the reader has not deadlocked. */
    virtual void monitor() = 0;
    virtual void monitor() = 0;


    /* Returns true if the input device is enabled. */
    virtual bool isInputDeviceEnabled(int32_t deviceId) = 0;

    /* Makes the reader start processing events from the kernel. */
    /* Makes the reader start processing events from the kernel. */
    virtual status_t start() = 0;
    virtual status_t start() = 0;


+0 −11
Original line number Original line Diff line number Diff line
@@ -874,17 +874,6 @@ std::optional<std::string> InputReader::getBluetoothAddress(int32_t deviceId) co
    return std::nullopt;
    return std::nullopt;
}
}


bool InputReader::isInputDeviceEnabled(int32_t deviceId) {
    std::scoped_lock _l(mLock);

    InputDevice* device = findInputDeviceLocked(deviceId);
    if (device) {
        return device->isEnabled();
    }
    ALOGW("Ignoring invalid device id %" PRId32 ".", deviceId);
    return false;
}

bool InputReader::canDispatchToDisplay(int32_t deviceId, ui::LogicalDisplayId displayId) {
bool InputReader::canDispatchToDisplay(int32_t deviceId, ui::LogicalDisplayId displayId) {
    std::scoped_lock _l(mLock);
    std::scoped_lock _l(mLock);


+0 −2
Original line number Original line Diff line number Diff line
@@ -61,8 +61,6 @@ public:


    std::vector<InputDeviceInfo> getInputDevices() const override;
    std::vector<InputDeviceInfo> getInputDevices() const override;


    bool isInputDeviceEnabled(int32_t deviceId) override;

    int32_t getScanCodeState(int32_t deviceId, uint32_t sourceMask, int32_t scanCode) override;
    int32_t getScanCodeState(int32_t deviceId, uint32_t sourceMask, int32_t scanCode) override;
    int32_t getKeyCodeState(int32_t deviceId, uint32_t sourceMask, int32_t keyCode) override;
    int32_t getKeyCodeState(int32_t deviceId, uint32_t sourceMask, int32_t keyCode) override;
    int32_t getSwitchState(int32_t deviceId, uint32_t sourceMask, int32_t sw) override;
    int32_t getSwitchState(int32_t deviceId, uint32_t sourceMask, int32_t sw) override;
+0 −3
Original line number Original line Diff line number Diff line
@@ -55,8 +55,6 @@ public:


    void monitor() { reader->monitor(); }
    void monitor() { reader->monitor(); }


    bool isInputDeviceEnabled(int32_t deviceId) { return reader->isInputDeviceEnabled(deviceId); }

    status_t start() { return reader->start(); }
    status_t start() { return reader->start(); }


    status_t stop() { return reader->stop(); }
    status_t stop() { return reader->stop(); }
@@ -206,7 +204,6 @@ extern "C" int LLVMFuzzerTestOneInput(uint8_t* data, size_t size) {
                },
                },
                [&]() -> void { reader->monitor(); },
                [&]() -> void { reader->monitor(); },
                [&]() -> void { reader->getInputDevices(); },
                [&]() -> void { reader->getInputDevices(); },
                [&]() -> void { reader->isInputDeviceEnabled(fdp->ConsumeIntegral<int32_t>()); },
                [&]() -> void {
                [&]() -> void {
                    reader->getScanCodeState(fdp->ConsumeIntegral<int32_t>(),
                    reader->getScanCodeState(fdp->ConsumeIntegral<int32_t>(),
                                             fdp->ConsumeIntegral<uint32_t>(),
                                             fdp->ConsumeIntegral<uint32_t>(),