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

Commit 043fbec6 authored by Josh Gao's avatar Josh Gao
Browse files

adb: add environment variables to disable usb, emulators, mdns.

Provide a way to selectively disable USB, automatic emulator
connection, and mDNS, to make reading through ADB_TRACE logging easier.

Test: manual
Change-Id: Ic6a06cdce14235415520cbf2d51c7f7031b7a7b3
parent e0323874
Loading
Loading
Loading
Loading
+13 −3
Original line number Diff line number Diff line
@@ -118,10 +118,20 @@ int adb_server_main(int is_daemon, const std::string& socket_spec, int ack_reply

    init_transport_registration();
    init_reconnect_handler();

    if (!getenv("ADB_MDNS") || strcmp(getenv("ADB_MDNS"), "0") != 0) {
        init_mdns_transport_discovery();
    }

    if (!getenv("ADB_USB") || strcmp(getenv("ADB_USB"), "0") != 0) {
        usb_init();
    } else {
        adb_notify_device_scan_complete();
    }

    if (!getenv("ADB_EMU") || strcmp(getenv("ADB_EMU"), "0") != 0) {
        local_init(DEFAULT_ADB_LOCAL_TRANSPORT_PORT);
    }

    std::string error;