Fixed to stop services of functionfs when gadget is disabled 35/227335/2
authorINSUN PYO <insun.pyo@samsung.com>
Wed, 11 Mar 2020 08:46:35 +0000 (17:46 +0900)
committerINSUN PYO <insun.pyo@samsung.com>
Wed, 11 Mar 2020 08:50:32 +0000 (17:50 +0900)
commit5e9327a2d5b5215b4371b406339dc83a89891074
tree842e87fba52323d032e064b9036f8f5b9b5672d1
parent3afe9b27685260317588ffc2b5b314bb68fdfaf8
Fixed to stop services of functionfs when gadget is disabled

sdb.service and mtp-responder.service are alive when the usb cable is unplugged in the configfs environment.

If the usb cable is disconnected, gadget disable is called.
These services are stopped when the gadget is disabled.

Caution 1
Note that the socket units for these services should remain.
The scoket unit has ep0 in the functionfs environment.
If ep0 disappears because the socket unit is stopped, the functionfs can never be enabled.

Caution 2
Since ffs_service works by socket activation, it will be started automatically when data is enqueued to the usb socket.
So when enabling configfs gadget, it doesn't start ffs_service.

Change-Id: I660e0cf157320f6a4e8f152a028772547dd701f6
hw/usb_cfs_client_common.c
hw/usb_gadget.h