am 94653364: Merge "Use init to write usb typec props" into mnc-dr-dev

* commit '946533648c49f2700b6e0f73383699597649ee60':
  Use init to write usb typec props
This commit is contained in:
Tim Kilbourn 2015-08-19 01:41:40 +00:00 committed by Android Git Automerger
commit bb41f7d6ed

View file

@ -89,3 +89,34 @@ on property:sys.usb.config=accessory,audio_source,adb
# when changing the default configuration
on property:persist.sys.usb.config=*
setprop sys.usb.config ${persist.sys.usb.config}
#
# USB type C
#
# USB mode changes
on property:sys.usb.typec.mode=dfp
write /sys/class/dual_role_usb/otg_default/mode ${sys.usb.typec.mode}
setprop sys.usb.typec.state ${sys.usb.typec.mode}
on property:sys.usb.typec.mode=ufp
write /sys/class/dual_role_usb/otg_default/mode ${sys.usb.typec.mode}
setprop sys.usb.typec.state ${sys.usb.typec.mode}
# USB data role changes
on property:sys.usb.typec.data_role=device
write /sys/class/dual_role_usb/otg_default/data_role ${sys.usb.typec.data}
setprop sys.usb.typec.state ${sys.usb.typec.data_role}
on property:sys.usb.typec.data_role=host
write /sys/class/dual_role_usb/otg_default/data_role ${sys.usb.typec.data}
setprop sys.usb.typec.state ${sys.usb.typec.data_role}
# USB power role changes
on property:sys.usb.typec.power_role=source
write /sys/class/dual_role_usb/otg_default/power_role ${sys.usb.typec.power}
setprop sys.usb.typec.state ${sys.usb.typec.power_role}
on property:sys.usb.typec.power_role=sink
write /sys/class/dual_role_usb/otg_default/power_role ${sys.usb.typec.power}
setprop sys.usb.typec.state ${sys.usb.typec.power_role}