Skip to content
Commit 758393a3 authored by Arthur Hung's avatar Arthur Hung
Browse files

Prevent NPE for onKeyDown and onKeyUp

We expected `onKeyDown` and `onKeyUp` should be used for the key event
delivery from input, but some apps may misuse it and pass a null
key event, that would cause app itself crash if it didn't override
onKeyDown and onKeyUp properly.

To prevent this, we swap the conditions that first check the confirm
key code then access the other states of the key event.

Bug: 219708835
Test: manual
Change-Id: I612ca560d768134bdcaa688c83217738b5254b5a
parent ef439b26
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