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

Commit 65a62372 authored by Badhri Jagan Sridharan's avatar Badhri Jagan Sridharan
Browse files

Overcome disconnect during oem override

Cherry-pick from 83a0d6fa

While bootup, usb gets configured when the property triggers are
run. While in oemOverride, the current configuration is persisted
in sys.usb.<bootmode>.config. Do not reconfigure the stack if the
current configuration is same as the new configuration.

Bug: 64225494
Change-Id: Id35d110bf3fa8f58d05e14941716d4ad2b196f8d
parent 999d998f
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -434,6 +434,8 @@ public class UsbDeviceManager {
            try {
                // Restore default functions.

                mCurrentOemFunctions = SystemProperties.get(UsbDeviceManager.getPersistProp(false),
                        UsbManager.USB_FUNCTION_NONE);
                if (isNormalBoot()) {
                    mCurrentFunctions = SystemProperties.get(USB_CONFIG_PROPERTY,
                            UsbManager.USB_FUNCTION_NONE);
@@ -662,8 +664,7 @@ public class UsbDeviceManager {
            }

            if ((!functions.equals(oemFunctions) &&
                    (mCurrentOemFunctions == null ||
                            !mCurrentOemFunctions.equals(oemFunctions)))
                            !mCurrentOemFunctions.equals(oemFunctions))
                    || !mCurrentFunctions.equals(functions)
                    || !mCurrentFunctionsApplied
                    || forceRestart) {