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

Commit 31d7a9c2 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Change InputReporter to InputReporterInterface"

parents bcb4be70 79a4f0c5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@
#include <unordered_map>

#include "InputListener.h"
#include "InputReporter.h"
#include "InputReporterInterface.h"


namespace android {
@@ -1190,7 +1190,7 @@ private:
    void traceOutboundQueueLengthLocked(const sp<Connection>& connection);
    void traceWaitQueueLengthLocked(const sp<Connection>& connection);

    sp<InputReporter> mReporter;
    sp<InputReporterInterface> mReporter;
};

/* Enqueues and dispatches input events, endlessly. */
+9 −3
Original line number Diff line number Diff line
/*
 * 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 @@ void InputReporter::reportDroppedKey(uint32_t sequenceNum) {
  // do nothing
}

sp<InputReporter> createInputReporter() {
sp<InputReporterInterface> createInputReporter() {
  return new InputReporter();
}

+9 −9
Original line number Diff line number Diff line
/*
 * 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,8 +14,8 @@
 * limitations under the License.
 */

#ifndef _UI_INPUT_REPORTER_H
#define _UI_INPUT_REPORTER_H
#ifndef _UI_INPUT_REPORTER_INTERFACE_H
#define _UI_INPUT_REPORTER_INTERFACE_H

#include <utils/RefBase.h>

@@ -25,9 +25,9 @@ namespace android {
 * The interface used by the InputDispatcher to report information about input events after
 * it is sent to the application, such as if a key is unhandled or dropped.
 */
class InputReporter: public virtual RefBase {
class InputReporterInterface : public virtual RefBase {
protected:
    virtual ~InputReporter() { }
    virtual ~InputReporterInterface() { }

public:
    // Report a key that was not handled by the system or apps.
@@ -35,19 +35,19 @@ public:
    //   - The event was not handled and there is no fallback key; or
    //   - The event was not handled and it has a fallback key,
    //       but the fallback key was not handled.
    virtual void reportUnhandledKey(uint32_t sequenceNum);
    virtual void reportUnhandledKey(uint32_t sequenceNum) = 0;

    // Report a key that was dropped by InputDispatcher.
    // A key can be dropped for several reasons. See the enum
    // InputDispatcher::DropReason for details.
    virtual void reportDroppedKey(uint32_t sequenceNum);
    virtual void reportDroppedKey(uint32_t sequenceNum) = 0;
};

/*
 * Factory method for InputReporter.
 */
sp<InputReporter> createInputReporter();
sp<InputReporterInterface> createInputReporter();

} // namespace android

#endif // _UI_INPUT_REPORTER_H
#endif // _UI_INPUT_REPORTER_INTERFACE_H