Skip to content
Commit 29d21d40 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
parent 7f5585cf
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment