mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2024-09-05 09:02:24 +00:00
![Tad](/assets/img/avatar_default.png)
- by disabling mtp over functionfs - affects both GrapheneOS and LineageOS - might need to be applied to other devices [pid 2482] ppoll([{fd=42, events=POLLIN}, {fd=51, events=POLLIN}], 2, {tv_sec=0, tv_nsec=0}, NULL, 0) = 0 (Timeout) lrwx------ 1 u0_a13 u0_a13 64 2019-09-05 18:47 42 -> /dev/usb-ffs/mtp/ep0 lrwx------ 1 u0_a13 u0_a13 64 2019-09-05 18:47 51 -> anon_inode:[eventfd] https://forum.xda-developers.com/android/help/pixel2-help-diagnose-android-process-t3863274 https://bugs.chromium.org/p/chromium/issues/detail?id=947901
43 lines
1.9 KiB
Diff
43 lines
1.9 KiB
Diff
diff --git a/init.common.usb.rc b/init.common.usb.rc
|
|
index 632b6495..23bdb19f 100644
|
|
--- a/init.common.usb.rc
|
|
+++ b/init.common.usb.rc
|
|
@@ -12,18 +12,13 @@ on boot
|
|
write /sys/class/android_usb/android0/f_rndis_qc/rndis_transports BAM2BAM_IPA
|
|
write /sys/module/g_android/parameters/mtp_tx_req_len 131072
|
|
write /sys/module/g_android/parameters/mtp_rx_req_len 131072
|
|
- setprop sys.usb.ffs.max_write 524288
|
|
- setprop sys.usb.ffs.max_read 524288
|
|
- setprop sys.usb.mtp.device_type 3
|
|
setprop sys.usb.rps_mask 0
|
|
|
|
on post-fs
|
|
- write /sys/class/android_usb/android0/f_ffs/aliases adb,mtp
|
|
+ write /sys/class/android_usb/android0/f_ffs/aliases adb
|
|
mkdir /dev/usb-ffs 0775 shell shell
|
|
mkdir /dev/usb-ffs/adb 0770 shell shell
|
|
mount functionfs adb /dev/usb-ffs/adb noatime uid=2000,gid=2000,no_disconnect=1
|
|
- mkdir /dev/usb-ffs/mtp 0770 mtp mtp
|
|
- mount functionfs mtp /dev/usb-ffs/mtp noatime rmode=0770,fmode=0660,uid=1024,gid=1024,no_disconnect=1
|
|
|
|
on property:sys.usb.config=mtp
|
|
stop adbd
|
|
@@ -81,7 +76,7 @@ on property:sys.usb.config=ptp
|
|
write /sys/class/android_usb/android0/bDeviceClass 0
|
|
write /sys/class/android_usb/android0/bDeviceSubClass 0
|
|
write /sys/class/android_usb/android0/bDeviceProtocol 0
|
|
- write /sys/class/android_usb/android0/functions mtp
|
|
+ write /sys/class/android_usb/android0/functions ${sys.usb.config}
|
|
write /sys/class/android_usb/android0/enable 1
|
|
setprop sys.usb.state ${sys.usb.config}
|
|
|
|
@@ -92,7 +87,7 @@ on property:sys.usb.config=ptp,adb
|
|
write /sys/class/android_usb/android0/bDeviceClass 0
|
|
write /sys/class/android_usb/android0/bDeviceSubClass 0
|
|
write /sys/class/android_usb/android0/bDeviceProtocol 0
|
|
- write /sys/class/android_usb/android0/functions mtp,adb
|
|
+ write /sys/class/android_usb/android0/functions ${sys.usb.config}
|
|
write /sys/class/android_usb/android0/enable 1
|
|
start adbd
|
|
setprop sys.usb.state ${sys.usb.config}
|