Add ffs.mtp.ready triggers to mtp configs.

This allows devices to use functionfs for mtp and ptp instead
of the ordinary functions. The property is set regardless of
which function is enabled so mtp and ptp functions will continue
to work.

Bug: 33220530
Test: use mtp with ffs and non ffs devices
Change-Id: I4527e153bd10ef1e262e487482ae455835d1c698
This commit is contained in:
Jerry Zhang 2017-04-14 18:48:24 -07:00
parent 47d15ed5b9
commit fb256b696b

View file

@ -2,6 +2,7 @@ on property:sys.usb.config=none && property:sys.usb.configfs=1
write /config/usb_gadget/g1/UDC "none"
stop adbd
setprop sys.usb.ffs.ready 0
setprop sys.usb.ffs.mtp.ready 0
write /config/usb_gadget/g1/bDeviceClass 0
write /config/usb_gadget/g1/bDeviceSubClass 0
write /config/usb_gadget/g1/bDeviceProtocol 0
@ -20,7 +21,7 @@ on property:sys.usb.ffs.ready=1 && property:sys.usb.config=adb && property:sys.u
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=mtp && property:sys.usb.configfs=1
on property:sys.usb.ffs.mtp.ready=1 && property:sys.usb.config=mtp && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp"
symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
@ -29,14 +30,15 @@ on property:sys.usb.config=mtp && property:sys.usb.configfs=1
on property:sys.usb.config=mtp,adb && property:sys.usb.configfs=1
start adbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=mtp,adb && property:sys.usb.configfs=1
on property:sys.usb.ffs.ready=1 && property:sys.usb.ffs.mtp.ready=1 && \
property:sys.usb.config=mtp,adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp_adb"
symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=ptp && property:sys.usb.configfs=1
on property:sys.usb.ffs.mtp.ready=1 && property:sys.usb.config=ptp && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ptp"
symlink /config/usb_gadget/g1/functions/ptp.gs1 /config/usb_gadget/g1/configs/b.1/f1
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
@ -45,7 +47,8 @@ on property:sys.usb.config=ptp && property:sys.usb.configfs=1
on property:sys.usb.config=ptp,adb && property:sys.usb.configfs=1
start adbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=ptp,adb && property:sys.usb.configfs=1
on property:sys.usb.ffs.ready=1 && property:sys.usb.ffs.mtp.ready=1 && \
property:sys.usb.config=ptp,adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ptp_adb"
symlink /config/usb_gadget/g1/functions/ptp.gs1 /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2