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

Commit 6ada0018 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Revert "Increase debounce time for DISCONNECT processing"" into sc-dev...

Merge "Revert "Increase debounce time for DISCONNECT processing"" into sc-dev am: 3e46e3bd am: f587a041 am: 3b800994

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16439364

Change-Id: Id796d4c633b90195850f03930107253d4cec7be2
parents 9001310c 3b800994
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -175,10 +175,7 @@ public class UsbDeviceManager implements ActivityTaskManagerInternal.ScreenObser
    // Delay for debouncing USB disconnects.
    // We often get rapid connect/disconnect events when enabling USB functions,
    // which need debouncing.
    private static final int DEVICE_STATE_UPDATE_DELAY = 3000;

    // Delay for debouncing USB disconnects on Type-C ports in host mode
    private static final int HOST_STATE_UPDATE_DELAY = 1000;
    private static final int UPDATE_DELAY = 1000;

    // Timeout for entering USB request mode.
    // Request is cancelled if host does not configure device within 10 seconds.
@@ -639,7 +636,7 @@ public class UsbDeviceManager implements ActivityTaskManagerInternal.ScreenObser
            msg.arg1 = connected;
            msg.arg2 = configured;
            // debounce disconnects to avoid problems bringing up USB tethering
            sendMessageDelayed(msg, (connected == 0) ? DEVICE_STATE_UPDATE_DELAY : 0);
            sendMessageDelayed(msg, (connected == 0) ? UPDATE_DELAY : 0);
        }

        public void updateHostState(UsbPort port, UsbPortStatus status) {
@@ -654,7 +651,7 @@ public class UsbDeviceManager implements ActivityTaskManagerInternal.ScreenObser
            removeMessages(MSG_UPDATE_PORT_STATE);
            Message msg = obtainMessage(MSG_UPDATE_PORT_STATE, args);
            // debounce rapid transitions of connect/disconnect on type-c ports
            sendMessageDelayed(msg, HOST_STATE_UPDATE_DELAY);
            sendMessageDelayed(msg, UPDATE_DELAY);
        }

        private void setAdbEnabled(boolean enable) {