在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);
    }
Logo

欢迎加入DeepSeek 技术社区。在这里,你可以找到志同道合的朋友,共同探索AI技术的奥秘。

更多推荐