Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c796f918 authored by Nikita Ioffe's avatar Nikita Ioffe
Browse files

Move `setprop sys.usb.configfs 0` to `on init` action

This should solve the problem of
`property:sys.usb.config=adb && property:sys.usb.configfs=0` action
being wrongly triggered during userspace reboot.

Also reset some adbd-related property in `on userspace-reboot-requested`
action to make sure that userspace reboot sequence is as close as
possible to normal boot sequence w.r.t adbd.

Test: adb reboot userspace
Test: checked property:sys.usb.config=adb && property:sys.usb.configfs=0
  action is not triggered

Bug: 135984674
Change-Id: Icf40386399ee84d01228020e65f71ba473d72822
parent 06126e1b
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -19,7 +19,9 @@ service adbd /system/bin/adbd --root_seclabel=u:r:su:s0
    updatable
    seclabel u:r:adbd:s0

on boot
# Set default value on sys.usb.configfs early in boot sequence. It will be
# overridden in `on boot` action of init.hardware.rc.
on init
    setprop sys.usb.configfs 0

# Used to disable USB when switching states
@@ -133,3 +135,8 @@ on property:sys.usb.typec.power_role=source
on property:sys.usb.typec.power_role=sink
    write /sys/class/dual_role_usb/otg_default/power_role ${sys.usb.typec.power_role}
    setprop sys.usb.typec.state ${sys.usb.typec.power_role}

on userspace-reboot-requested
  setprop sys.usb.config ""
  setprop sys.usb.configfs ""
  setprop sys.usb.state ""