高通QFIL,開關usb除錯埠,無法識別到下載埠

王大錘扛刀發表於2020-11-19

在UsbDeviceManager 中

private void setAdbEnabled(boolean enable) {
    if (DEBUG) Slog.d(TAG, "setAdbEnabled: " + enable);
    if (enable != mAdbEnabled) {
        mAdbEnabled = enable;
        /*jicong.wang modify for bug 8540 start {@*/
        String functions  = getSystemProperty("persist.vendor.usb.config", "");
        if (enable) {
            setSystemProperty(USB_PERSISTENT_CONFIG_PROPERTY,functions);
            functions = UsbHandlerLegacy.addFunction(functions, UsbManager.USB_FUNCTION_ADB);
        } else {
            setSystemProperty(USB_PERSISTENT_CONFIG_PROPERTY, "");
            functions = UsbHandlerLegacy.removeFunction(functions,UsbManager.USB_FUNCTION_ADB);
        }
        setSystemProperty("persist.vendor.usb.config",functions);
        /*jicong.wang modify for bug 8540 end @}*/
        setEnabledFunctions(mCurrentFunctions, true);
        updateAdbNotification(false);
    }

相關文章