From bdd4728a17abc50075ae62c170edaff5744afc4c Mon Sep 17 00:00:00 2001 From: Ray Chi Date: Thu, 18 Nov 2021 12:07:24 +0800 Subject: [PATCH] usb: modify the permission of USB gadget hal Currently, USB gadgdet hal couldn't access configfs nodes during device booting. The permission of configfs nodes are root as default, and they are modified to system by init process. Therefore, USB gadget HAL can't access them before permission changes completely. The patch will modify permission of USB gadget hal so that it can access configfs nodes without permission change. Bug: 204378488 Test: check connection time Change-Id: I97f5446a51183225227744043e4a6e0088fecf0b --- conf/init.gs201.usb.rc | 3 ++- usb/android.hardware.usb@1.3-service.gs201.rc | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/conf/init.gs201.usb.rc b/conf/init.gs201.usb.rc index be407742..3fb626a3 100644 --- a/conf/init.gs201.usb.rc +++ b/conf/init.gs201.usb.rc @@ -67,7 +67,8 @@ on early-boot # etr_miu function mkdir /config/usb_gadget/g1/functions/etr_miu.gs11 - setprop vendor.usb.functions.ready 1 + # disable permission change. TODO (b/206902205): add back later + # setprop vendor.usb.functions.ready 1 on boot write /config/usb_gadget/g1/bcdDevice 0x0510 diff --git a/usb/android.hardware.usb@1.3-service.gs201.rc b/usb/android.hardware.usb@1.3-service.gs201.rc index a1292ef9..10ede6ee 100644 --- a/usb/android.hardware.usb@1.3-service.gs201.rc +++ b/usb/android.hardware.usb@1.3-service.gs201.rc @@ -1,7 +1,8 @@ +# TODO (b/206902205): remove root permission later service vendor.usb-hal-1-3 /vendor/bin/hw/android.hardware.usb@1.3-service.gs201 class hal - user system - group system shell mtp + user root + group root system shell mtp on post-fs chown root system /sys/class/typec/port0/power_role