Skip to content
Snippets Groups Projects
Commit 129886e1 authored by Carlo Savignano's avatar Carlo Savignano Committed by Mohammad Hasan Keramat J
Browse files

input: introduce new navigation bar key event source


* When generating virtual navigation bar KeyEvent, set
  a specific source fort it. There is no precise way to
  recognize if the KeyEvent is coming from KeyButtonView.
  Another way is passing another flag.

Change-Id: I243c9f91afcbf4c430e2d526e8c814a5a7975e51
Signed-off-by: default avatarMohammad Hasan Keramat J <ikeramat80@gmail.com>
parent d1802696
Branches ten
No related tags found
No related merge requests found
......@@ -308,6 +308,15 @@ public final class InputDevice implements Parcelable {
*/
public static final int SOURCE_HDMI = 0x02000000 | SOURCE_CLASS_BUTTON;
/**
* The input source is a specific virtual event sent from navigation bar.
*
* @see com.android.systemui.statusbar.policy.KeyButtonView#sendEvent()
* @author Carlo Savignano
* @hide
*/
public static final int SOURCE_NAVIGATION_BAR = 0x04000000 | SOURCE_CLASS_BUTTON;
/**
* A special input source constant that is used when filtering input devices
* to match devices that provide any type of input source.
......
......@@ -419,7 +419,7 @@ public class KeyButtonView extends ImageView implements ButtonInterface {
final KeyEvent ev = new KeyEvent(mDownTime, when, action, mCode, repeatCount,
0, KeyCharacterMap.VIRTUAL_KEYBOARD, 0,
flags | KeyEvent.FLAG_FROM_SYSTEM | KeyEvent.FLAG_VIRTUAL_HARD_KEY,
InputDevice.SOURCE_KEYBOARD);
InputDevice.SOURCE_NAVIGATION_BAR);
int displayId = INVALID_DISPLAY;
......
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