Send valid displayId and eventTime for edge back event

Display ID is set to invalid and downtime is same as
event time for ACTION_UP in gesture nav. Use default
displayId if bubbles displayId is invalid.

Bug: 156718868
Change-Id: Ia20b749816323d53a6f5901ab475d35e02013324
This commit is contained in:
Vinit Nayak
2020-06-29 16:56:30 -07:00
parent 5937ba4b0d
commit 3ad6390b26

View File

@@ -614,8 +614,10 @@ public class EdgeBackGestureHandler extends CurrentUserTracker implements Displa
// Bubble controller will give us a valid display id if it should get the back event
BubbleController bubbleController = Dependency.get(BubbleController.class);
int bubbleDisplayId = bubbleController.getExpandedDisplayId(mContext);
if (code == KeyEvent.KEYCODE_BACK && bubbleDisplayId != INVALID_DISPLAY) {
if (bubbleDisplayId != INVALID_DISPLAY) {
ev.setDisplayId(bubbleDisplayId);
} else {
ev.setDisplayId(mContext.getDisplay().getDisplayId());
}
InputManager.getInstance().injectInputEvent(ev, InputManager.INJECT_INPUT_EVENT_MODE_ASYNC);
}