Skip to content
Commit c8362b24 authored by Garfield Tan's avatar Garfield Tan
Browse files

Add ID to InputEvent.

The interaction between Java and native code for KeyEvent and
MotionEvent is different, so I used different arrangement to pass
sequence number across JNI that keeps the consistency with other
metadata.

Unfortunately this new ID doesn't have absolute uniqueness guarantee so
it can't replace InputEvent#getSequenceNumber() which is used with a
strict in-process uniqueness assumption. Therefore only convert systrace
related use to ID.

Also expose ID generator through a static function in InputEvent so that
everyone can use it. InputReader and InputDispatcher will use different
instances.

Bug: 144889238
Test: Build and run.
Test: atest FrameworksCoreTests:KeyEventTest
Test: atest FrameworksCoreTests:MotionEventTest
Change-Id: Icbdcaee1d98948c05484865a4e15e55161ecfa69
Merged-In: Icbdcaee1d98948c05484865a4e15e55161ecfa69
(cherry picked from 29d21d40)
parent 27f83cdb
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment