mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 10:44:41 +00:00
Add reset to InputClassifier HAL
The reset will be used to prevent an inconsistent stream of events to be sent to the HAL. Bug: 111480215 Test: make only Change-Id: I40c7d671f094065e3fcaff0d83e826c580dcae7a
This commit is contained in:
@@ -26,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);
|
||||
|
||||
};
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -34,6 +34,9 @@ struct InputClassifier : public IInputClassifier {
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user