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

Commit 43fd1a4e authored by Badhri Jagan Sridharan's avatar Badhri Jagan Sridharan
Browse files

adb: Do not signal gaget stack unless descriptors are written

While recovering from endpoint errors, the gadget stack was being
signalled even when desriptors were NOT being rewritten. Avoid this
as this might cause enumeration loops.

Bug: 36036550
Change-Id: Iff2b2fc8cded001ef3c77dc170dce3b96848970c
parent 5811a434
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -283,6 +283,8 @@ bool init_functionfs(struct usb_handle* h) {
            D("[ %s: writing strings failed: errno=%d]", USB_FFS_ADB_EP0, errno);
            D("[ %s: writing strings failed: errno=%d]", USB_FFS_ADB_EP0, errno);
            goto err;
            goto err;
        }
        }
        //Signal only when writing the descriptors to ffs
        android::base::SetProperty("sys.usb.ffs.ready", "1");
    }
    }


    h->bulk_out = adb_open(USB_FFS_ADB_OUT, O_RDWR);
    h->bulk_out = adb_open(USB_FFS_ADB_OUT, O_RDWR);
@@ -358,7 +360,6 @@ static void usb_ffs_open_thread(void* x) {
            }
            }
            std::this_thread::sleep_for(1s);
            std::this_thread::sleep_for(1s);
        }
        }
        android::base::SetProperty("sys.usb.ffs.ready", "1");


        D("[ usb_thread - registering device ]");
        D("[ usb_thread - registering device ]");
        register_usb_transport(usb, 0, 0, 1);
        register_usb_transport(usb, 0, 0, 1);