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

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

Merge changes from topic "heatmap"

* changes:
  Add reset to InputClassifier HAL
  Move input definitions into separate HAL
parents 379a96e1 ba9d3c83
Loading
Loading
Loading
Loading
+1 −18
Original line number Diff line number Diff line
@@ -7,29 +7,12 @@ hidl_interface {
        enabled: true,
    },
    srcs: [
        "types.hal",
        "IInputClassifier.hal",
    ],
    interfaces: [
        "android.hardware.input.common@1.0",
        "android.hidl.base@1.0",
    ],
    types: [
        "Action",
        "Axis",
        "Button",
        "Classification",
        "EdgeFlag",
        "Flag",
        "Meta",
        "MotionEvent",
        "PointerCoords",
        "PointerProperties",
        "PolicyFlag",
        "Source",
        "SourceClass",
        "ToolType",
        "VideoFrame",
    ],
    gen_java: true,
}
+15 −0
Original line number Diff line number Diff line
@@ -16,6 +16,9 @@

package android.hardware.input.classifier@1.0;

import android.hardware.input.common@1.0::Classification;
import android.hardware.input.common@1.0::MotionEvent;

interface IInputClassifier {

  /**
@@ -23,4 +26,16 @@ interface IInputClassifier {
   */
  classify(MotionEvent event) generates (Classification classification);

  /**
   * Called by the framework to reset the HAL internal state. The reset may be called
   * to prevent an inconsistent stream of events to be sent to the HAL.
   */
  reset();

  /**
   * Called by the framework to reset the HAL internal state for a specific device.
   * The reset may be called once device reset is received by the framework.
   */
  resetDevice(int32_t deviceId);

};
+13 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@
#include <log/log.h>
#include <utils/Timers.h>

using namespace android::hardware::input::classifier::V1_0;
using namespace android::hardware::input::common::V1_0;

namespace android {
namespace hardware {
@@ -57,6 +57,18 @@ Return<Classification> InputClassifier::classify(const MotionEvent& event) {
    return Classification::NONE;
}

Return<void> InputClassifier::reset() {
    // We don't have any internal state in this example implementation,
    // so no work needed here.
    return Void();
}

Return<void> InputClassifier::resetDevice(int32_t /*deviceId*/) {
    // We don't have any internal per-device state in this example implementation,
    // so no work needed here.
    return Void();
}

}  // namespace implementation
}  // namespace V1_0
}  // namespace classifier
+6 −2
Original line number Diff line number Diff line
@@ -31,8 +31,12 @@ using ::android::hardware::Return;

struct InputClassifier : public IInputClassifier {
    // Methods from ::android::hardware::input::classifier::V1_0::IInputClassifier follow.
    Return<Classification> classify(
        const ::android::hardware::input::classifier::V1_0::MotionEvent& event) override;

    Return<android::hardware::input::common::V1_0::Classification> classify(
            const android::hardware::input::common::V1_0::MotionEvent& event) override;

    Return<void> reset() override;
    Return<void> resetDevice(int32_t deviceId) override;
};

}  // namespace implementation
+34 −0
Original line number Diff line number Diff line
// This file is autogenerated by hidl-gen -Landroidbp.

hidl_interface {
    name: "android.hardware.input.common@1.0",
    root: "android.hardware",
    vndk: {
        enabled: true,
    },
    srcs: [
        "types.hal",
    ],
    interfaces: [
        "android.hidl.base@1.0",
    ],
    types: [
        "Action",
        "Axis",
        "Button",
        "Classification",
        "EdgeFlag",
        "Flag",
        "Meta",
        "MotionEvent",
        "PointerCoords",
        "PointerProperties",
        "PolicyFlag",
        "Source",
        "SourceClass",
        "ToolType",
        "VideoFrame",
    ],
    gen_java: true,
}
Loading