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

Commit 31b9c172 authored by Nick Kralevich's avatar Nick Kralevich Committed by Android (Google) Code Review
Browse files

Merge "UsbDeviceManager: Modify default function handling" into mnc-dev

parents 1035833f 43965fe5
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -352,7 +352,7 @@ public class UsbDeviceManager {
                        SystemProperties.get(UsbManager.ADB_PERSISTENT_PROPERTY, "adb"),
                        UsbManager.USB_FUNCTION_ADB);

                mCurrentFunctions = mAdbEnabled ? "adb" : UsbManager.USB_FUNCTION_MTP;
                mCurrentFunctions = getDefaultFunctions();
                String state = FileUtils.readTextFile(new File(STATE_PATH), 0, null).trim();
                updateState(state);

@@ -474,7 +474,7 @@ public class UsbDeviceManager {
            if (DEBUG) Slog.d(TAG, "setEnabledFunctions " + functions);

            if (functions == null) {
                functions = "none";
                functions = getDefaultFunctions();
            }

            if (mAdbEnabled) {
@@ -795,7 +795,7 @@ public class UsbDeviceManager {
        }

        private String getDefaultFunctions() {
            return UsbManager.USB_FUNCTION_MTP;
            return mAdbEnabled ? UsbManager.USB_FUNCTION_ADB : UsbManager.USB_FUNCTION_MTP;
        }

        public void dump(FileDescriptor fd, PrintWriter pw) {