A new field was added where bus can be specified for testing uhid
devices. This commit adds the relevant documention to the README.
Bug: 144949707
Test: none
Change-Id: If5f6673dd0fdd268b702119b6ccd4abdc37f65bd
Sony introduced some logic that combines devices kernel splits into one
Android device based on identical pid, vid and non-empty uniq. Therefore
populate this field with device ID.
We can change that to a separate uniq attribute in register JSON file if
necessary later.
Bug: 38511270
Test: getevent -li shows that uniq is populated.
Change-Id: Ieca0b826c86e9cad7fa3d3c8f98b9cfd54d20c73
When testing HID devices, it was assumed that the bus used would always
be bluetooth. This caused USB hid tests to fail. This patch fixes this
issue by adding a "busType" parameter to the test register file. This
can be either "bluetooth" or "usb" at this time. This will break any
hid test that does not specify a busType.
Cherry picked from pa/1549664.
Bug: 136263708
Test: atest CtsHarwareTestCases
Change-Id: I44cda52505110227fa5262994d0cfe59ecb8763d
Some joysticks may send UHID_OUTPUT requests during probe. They expect
to receive a report in response. Provide a facility to specify the
expected outputs from the driver, and a way to respond to each of these
requests. Typically, this would be something like "driver: please use
full report mode", "joystick: ACK". If the ACK is not received by the
driver, the probe would fail, and input device would never get
registered.
Bug: 135136477
Test: atest NintendoSwitchProTest
Change-Id: Ic2c7a73d3d4bf759a1a104324687cd01646f256e
We are adding new report types, and it is easier to use switch
statements to ensure that the default case is handled.
Also, expand the diagnostic messaging for SET_REPORT type, because it is
useful to see the actual data.
Bug: none
Test: atest NintendoSwitchProTest
Change-Id: I330e3b1464ae8e35a57d448e460cdb55ebbf6260
This function will also be used for handling UHID_OUTPUT. It also moves
all error checking into a single place.
Bug: none
Test: NintendoSwitchProTest
Change-Id: I72faa4bbfbe41842bbb651730dbd614c5bcbbaea
It is safer to use unique_fd because we don't have to worry about
closing it.
Bug: none
Test: atest NintendoSwitchProTest
Change-Id: I7bb0fb23ede65cf503f59a6e48cd708f0e99bba8
See build/soong/README.md for more information.
Also converts the rest of frameworks/base/tools/streaming_proto.
Bug: 122332340
Test: m checkbuild
Change-Id: I87c500c5464fb1722b4b518d89065f5e1ee29a97
(cherry picked from commit 45c0d71e77)
See build/soong/README.md for more information.
Also converts the rest of frameworks/base/tools/streaming_proto.
Bug: 122332340
Test: m checkbuild
Change-Id: I87c500c5464fb1722b4b518d89065f5e1ee29a97
Merged-In: Ieb54feb3902bddfd5a571369fbf50161ae646647
Test: atest CtsHardwareTestCases (between 2 and 4 failing tests, but that
happens on clean ToT too; no dlopen failures)
Bug: 126601993
Change-Id: Icfe58fad93b97992e39758c02c92c488a13c717f
Updated to support UHID_GET_REPORT requests mainly for CTS use.
All feature reports are assumed to be static and should be specified
along with the register json.
For example, in sony_dualshock4_register.json, add the following.
"feature_reports": [
{
"id": 5,
"data": [0x05, 0x1e, 0x00, 0x05, 0x00, 0xe2, 0xff, 0xf2, 0x22, 0xbe, 0x22, 0x8d, 0x22, 0x4f,
0xdd, 0x4d, 0xdd, 0x39, 0xdd, 0x1c, 0x02, 0x1c, 0x02, 0xe3, 0x1f, 0x8b, 0xdf, 0x8c, 0x1e,
0xb4, 0xde, 0x30, 0x20, 0x71, 0xe0, 0x10, 0x00, 0xca, 0xfc, 0x64, 0x4d]
}
]
Test: Make sure build has hid-sony driver that's backported from >4.10.
Run Dualshock4 CTS
> atest cts/tests/tests/hardware/src/android/hardware/input/cts/tests/SonyDualshock4TestCase.java
Change-Id: Ib0d534d47c6aa6fcc11af68b913c3db1cfa72752
Currently there are a few overflows possible in the hid command by
sending malformed json requests. Refactor the code to avoid these
overflows. These are mostly memcpy usage, where the size comes
(indirectly) from the size of the json array.
The json array must still be valid, because invalid json will produce an
earlier exception in the java layer.
Test: hid malformed_commands.json
The file "malformed_commands.json" can be found in the bug.
Bug: 111363077
Merged-In: I2f9dd31e0bfa2badc58779f40f4a80e025754cd2
(cherry picked from commit d54b70c8bf)
Change-Id: I2f9dd31e0bfa2badc58779f40f4a80e025754cd2
CREATE2 structs were introduced after kernel 3.18,
so cannot compile user code with uapi headers from
newer 3.18+ kernels. If using CREATE structs then
compatibility is preserved.
Bug: 64981084
Test: bit
Change-Id: I97c7725918b09a817a51c13384ac2d55a6cfab25
CtsHardwareTestCases:android.hardware.input.cts.tests.GamepadTestCase
libnativehelper exports headers under nativehelper. These were
available before incorrectly as global headers in order to give
access to jni.h.
Test: modules using ScopedUtfChars find headers
Bug: 63762847
Change-Id: I5e9f2b56f569b83ece0d854f7066655e1d64cc65
libnativehelper exports headers under nativehelper. These were
available before incorrectly as global headers in order to give
access to jni.h.
Test: com.android.server finds headers
Bug: 63762847
Change-Id: Icb3018f520004f65e8dd565d6e1d563551548eba
Hid command, JNI layer:
- Removed dependency of the hid device on libandroid_runtime
and libutils. Using ALooper from libandroid to process callbacks from
/dev/uhid file descriptor.
- Switched to using "CREATE2" and "INPUT2" constructs in uhid driver
Hid command, Java layer:
- Removed delay workarounds, user now responsible for waiting for
onInputDeviceChanged notification prior to using the hid commands.
UiAutomation:
- Added a new executeShellCommandRw function that allows bidirectional
communication to shell command
platform.xml:
- Added uhid permissions to bluetooth stack for /dev/uhid access
- CTS test now consistently passes
Bug: 34052337
Test: CTS test case invoked with the following command:
run cts -t android.hardware.input.cts.tests.GamepadTestCase
-m CtsHardwareTestCases --skip-system-status-check
com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker
Change-Id: Ic916c513b7e652b1e25675f0f38f0f1f3a65d214
To install libhidcommand_jni.so and hid command at the same time,
set libhidcommand_jni as a required module of hid command.
Bug: 22131060
Change-Id: I73ad1954eb73896425362a63fab0e63a61b9c0a0