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

Commit ad962a92 authored by Jerry Zhang's avatar Jerry Zhang
Browse files

Only force reset when adb is not enabled (i.e. mtp is)

Some users depended on adbd continuing to run after disconnect
in order to use scripts with nohup. This change allows this
use case to keep working since only mtp has to be force
set.

Bug: 38227228
Test: adb shell "nohup sh /sdcard/script" where script contains
"sleep 5; touch /sdcard/done" and verified file still appears even if
disconnected during sleep.
Test: am force-stop com.android.providers.media, still connects

Change-Id: I25ae2b922fa4d06109ac8cf5e43e1c47a33c46a6
parent a7af3852
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -855,7 +855,7 @@ public class UsbDeviceManager {
                        if (!mConnected) {
                            // restore defaults when USB is disconnected
                            Slog.i(TAG, "Disconnect, setting usb functions to null");
                            setEnabledFunctions(null, true, false);
                            setEnabledFunctions(null, !mAdbEnabled, false);
                        }
                        updateUsbFunctions();
                    } else {