Unity does not process events from evdev device created before unity is restarted (autopilot tests)
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Autopilot |
Invalid
|
Undecided
|
Unassigned | |||
Mir |
Fix Released
|
High
|
Daniel d'Andrada | |||
mir (Ubuntu) |
Fix Released
|
High
|
Unassigned | |||
unity8 (Ubuntu) | ||||||
Vivid |
Fix Released
|
Undecided
|
Michał Sawicz |
Bug Description
Unity does not process events from evdev device created before unity is restarted (i.e. in autopilot tests)
Brief:
In an autopilot test if you have a touch device object, launch unity, do some tapping/dragging, stop unity, start it again the same created device will have no effect on the new unity.
(i.e. attempt to swipe greeter will fail)
* To reproduce using python shell:
(Have 2 terminals, both on the device(ssh/adb shell); one for python shell the other for starting/stopping unity)
1. Make sure unity8 is running on the device
2. In the python shell execute:
from autopilot.input import Touch
touch = Touch.create()
touch.drag(
3. You will see the greeter disappear/dash move/some movement.
4. Restart unity (without restarting the python shell)
stop unity8
start unity8
5. Back in the python terminal, re-execute the drag:
touch.drag(
6. Nothing will happen to unity (no greeter movement etc.)
7. (Work around) Re-create the device to get movement back (in python terminal):
from autopilot.input import _uinput
_uinput.
touch.drag(
7b. Or you can kill the python shell and do the pythno steps from scratch, but that just does `_uinput.
* To reproduce using autopilot:
Any test after the first fails due to input not being processed by the evdev device that was created before unity8 is started.
# Run at least 2 tests:
$ autopilot run -v unity8.
The second test will fail due to failing to swipe the greeter away.
* Extra details:
If I add extra logging:
$ initctl set-env MIR_SERVER_
$ initctl set-env MIR_SERVER_
I see details in the logs (~/.cache/
...
[II, input] Received event (when, type, code, value) from kernel: (13814643363359
[II, input] Received event (when, type, code, value) from kernel: (13814643363359
[II, input] Published motion event (seq_id, event_time) to fd 65: (305, 138146433633596
[II, input] Received event finished (seq_id) from fd 65: 305
...
But nothing happens on the screen (I am able to manually swipe the screen).
* Workaround
A work around is to add this to the test setup:
from autopilot.input import _uinput
Which forces the creation of a new device for this specific test run and instance of unity.
Related branches
- PS Jenkins bot (community): Needs Fixing (continuous-integration)
- Michael Zanetti (community): Approve
-
Diff: 15 lines (+6/-0)1 file modifiedtests/autopilot/unity8/shell/tests/__init__.py (+6/-0)
- Alexandros Frantzis (community): Approve
- Daniel van Vugt: Approve
- PS Jenkins bot (community): Approve (continuous-integration)
- Kevin DuBois (community): Approve
-
Diff: 89 lines (+37/-1)3 files modified3rd_party/android-input/android/frameworks/base/services/input/InputReader.cpp (+4/-1)
3rd_party/android-input/android/frameworks/base/services/input/InputReader.h (+2/-0)
tests/unit-tests/android_input/input_reader.cpp (+31/-0)
Changed in mir: | |
status: | Confirmed → Fix Committed |
Changed in unity8: | |
assignee: | nobody → Michał Sawicz (saviq) |
status: | New → Fix Committed |
tags: | added: doesnt-need-test |
description: | updated |
Changed in autopilot: | |
status: | New → Invalid |
Changed in mir: | |
assignee: | nobody → Daniel d'Andrada (dandrader) |
Changed in mir: | |
milestone: | none → 0.1.5 |
Changed in mir: | |
importance: | Critical → High |
Changed in mir: | |
status: | Fix Committed → Fix Released |
Changed in unity8 (Ubuntu Vivid): | |
assignee: | nobody → Michał Sawicz (saviq) |
status: | New → Fix Released |
no longer affects: | unity8 |
Dropped to High. We reserve critical for "my desktop/phone is unusable".