mtp

Merge lp:~cyphermox/mtp/lp1410506 into lp:mtp

Proposed by Mathieu Trudel-Lapierre
Status: Merged
Approved by: Ricardo Salveti
Approved revision: 60
Merged at revision: 60
Proposed branch: lp:~cyphermox/mtp/lp1410506
Merge into: lp:mtp
Diff against target: 22 lines (+7/-2)
1 file modified
debian/mtp-server.conf (+7/-2)
To merge this branch: bzr merge lp:~cyphermox/mtp/lp1410506
Reviewer Review Type Date Requested Status
Ricardo Salveti (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+246783@code.launchpad.net

Commit message

Adjust start and stop conditions to properly handle USB connection *and*
disconnection, and to do the right thing at boot-time if USB is connected
already.

This means we need to handle the case where USB is *not* connected when
unity8 starts; by checking its state explicitly as the job starts.

Description of the change

Adjust start and stop conditions to properly handle USB connection *and*
disconnection, and to do the right thing at boot-time if USB is connected
already.

This means we need to handle the case where USB is *not* connected when
unity8 starts; by checking its state explicitly as the job starts.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Oliver Grawert (ogra) wrote :

do you really want the mtp server to run if mtp is switched off for the gadget ?

i think you rather want:

start on (:sys:android-usb-connected and :sys:android-mtp-on) and (started unity8)

(you dont want it to start if unity8 isnt up because you cant get the screen lock state then, thus the "and (started unity8)")

Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

No, this is on purpose, so that things actually start up properly if you boot the device while connected to USB. Right now the mtp is always on in the gadget, we can revisit this and do further checking for the state if that changes.

Regardless of the events, half the time when we wait for the event or manually trigger them and unity8 is already started (with the and clause), the job does not start.

lp:~cyphermox/mtp/lp1410506 updated
60. By Mathieu Trudel-Lapierre

Fix logic issue in DISCONNECTED state check

Revision history for this message
Ricardo Salveti (rsalveti) wrote :

LGTM, works fine when I get the usb-connected and disconnected events.

review: Approve
lp:~cyphermox/mtp/lp1410506 updated
61. By Mathieu Trudel-Lapierre

Merge with trunk

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/mtp-server.conf'
2--- debian/mtp-server.conf 2015-01-20 00:54:30 +0000
3+++ debian/mtp-server.conf 2015-01-20 15:38:24 +0000
4@@ -1,11 +1,16 @@
5 description "MTP protocol server"
6
7-start on (:sys:android-mtp-on or :sys:android-usb-connected or android-mtp-on or android-usb-connected) and (started unity8)
8-stop on desktop-end or :sys:android-mtp-off or android-mtp-off
9+start on :sys:android-usb-connected or android-usb-connected or :sys:android-mtp-on or android-mtp-on or started unity8
10+stop on :sys:android-usb-disconnected or android-usb-disconnected or :sys:android-mtp-off or android-mtp-off or desktop-end
11
12 pre-start script
13 [ "$USER" != "lightdm" ] || { stop; exit 0; }
14
15+ if grep -qc DISCONNECTED /sys/devices/virtual/android_usb/android0/state;
16+ then
17+ stop; exit 0;
18+ fi
19+
20 # Fix for bug LP: #1389223: UnityGreeter isn't available immediately
21 if ! dbus-send --session --print-reply \
22 --dest=com.canonical.UnityGreeter \

Subscribers

People subscribed via source and target branches