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

Commit 20b1414f authored by Jerry Zhang's avatar Jerry Zhang
Browse files

Initialize functions as NONE in legacy handler.

Since adb is being removed from the functions read
from sys.usb.config anyway, it makes more sense to
set it to NONE on boot. This prevents errors with
devices that already have oem functions in the config.

Bug: 73010922
Test: Power test passes
Change-Id: I855ba228dbdd9f8c8a91842a8beb68a789fdf1e9
parent 4e056c8b
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -1359,9 +1359,7 @@ public class UsbDeviceManager implements ActivityManagerInternal.ScreenObserver
                            UsbManager.USB_FUNCTION_NONE).equals(
                            getSystemProperty(USB_STATE_PROPERTY, UsbManager.USB_FUNCTION_NONE));
                }
                // Mask out adb, since it is stored in mAdbEnabled
                mCurrentFunctions = UsbManager.usbFunctionsFromString(mCurrentFunctionsStr)
                        & ~UsbManager.FUNCTION_ADB;
                mCurrentFunctions = UsbManager.FUNCTION_NONE;
                mCurrentUsbFunctionsReceived = true;

                String state = FileUtils.readTextFile(new File(STATE_PATH), 0, null).trim();