Add API to get KeyCode produced by physical key location.
The physical key location is provided as a location KeyCode pointing to a location on a US keyboard layout.
Bug: 179812917
Test: atest KeyboardLayoutChangeTest
Test: atest android.hardware.input.cts.tests -m
Test: atest inputflinger_tests -m
Change-Id: Ib5ed41890cbbe393ee9ada1a04cbaaf82c9bb1fc
diff --git a/services/inputflinger/reader/include/EventHub.h b/services/inputflinger/reader/include/EventHub.h
index 1f96294..18e912d 100644
--- a/services/inputflinger/reader/include/EventHub.h
+++ b/services/inputflinger/reader/include/EventHub.h
@@ -306,6 +306,7 @@
virtual int32_t getSwitchState(int32_t deviceId, int32_t sw) const = 0;
virtual status_t getAbsoluteAxisValue(int32_t deviceId, int32_t axis,
int32_t* outValue) const = 0;
+ virtual int32_t getKeyCodeForKeyLocation(int32_t deviceId, int32_t locationKeyCode) const = 0;
/*
* Examine key input devices for specific framework keycode support
@@ -482,6 +483,8 @@
int32_t getScanCodeState(int32_t deviceId, int32_t scanCode) const override final;
int32_t getKeyCodeState(int32_t deviceId, int32_t keyCode) const override final;
int32_t getSwitchState(int32_t deviceId, int32_t sw) const override final;
+ int32_t getKeyCodeForKeyLocation(int32_t deviceId,
+ int32_t locationKeyCode) const override final;
status_t getAbsoluteAxisValue(int32_t deviceId, int32_t axis,
int32_t* outValue) const override final;