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

Commit 12f32848 authored by Josh Gao's avatar Josh Gao
Browse files

adbd: switch the default USB implementation.

Switch to the nonblocking FFS implementation that fixes several race
conditions on connect/disconnect.

Test: treehugger
Change-Id: I91fdb9b27152078cb38e610861a05f1fa95aa3a2
parent c0b831bb
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -628,9 +628,10 @@ static void usb_ffs_open_thread() {
}
}


void usb_init() {
void usb_init() {
    if (!android::base::GetBoolProperty("persist.adb.nonblocking_ffs", false)) {
    bool use_nonblocking = android::base::GetBoolProperty("persist.adb.nonblocking_ffs", true);
        usb_init_legacy();
    if (use_nonblocking) {
    } else {
        std::thread(usb_ffs_open_thread).detach();
        std::thread(usb_ffs_open_thread).detach();
    } else {
        usb_init_legacy();
    }
    }
}
}