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

Commit 31f5b687 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Enable MTP or ADB when default functions are enabled"

parents 972bad87 7f3047e6
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -1232,10 +1232,13 @@ public class UsbDeviceManager {
        private String getDefaultFunctions() {
            String func = SystemProperties.get(getPersistProp(true),
                    UsbManager.USB_FUNCTION_NONE);
            if (UsbManager.USB_FUNCTION_NONE.equals(func)) {
                func = UsbManager.USB_FUNCTION_MTP;
            // if ADB is enabled, reset functions to ADB
            // else enable MTP as usual.
            if (UsbManager.containsFunction(func, UsbManager.USB_FUNCTION_ADB)) {
                return UsbManager.USB_FUNCTION_ADB;
            } else {
                return UsbManager.USB_FUNCTION_MTP;
            }
            return func;
        }

        public void dump(IndentingPrintWriter pw) {