Snap for 11973804 from 4f43c1cdaf to 24Q3-release

Change-Id: I4b59a7b0a9abec8e46737fa359d9a50a2c8fd51b
This commit is contained in:
Android Build Coastguard Worker 2024-06-15 01:03:34 +00:00
commit f4d01f9d1b
2 changed files with 6 additions and 0 deletions

View file

@ -672,6 +672,11 @@ ScopedAStatus Usb::switchRole(const string& in_portName, const PortRole& in_role
fp = fopen(filename.c_str(), "w");
if (fp != NULL) {
int ret = fputs(convertRoletoString(in_role).c_str(), fp);
if (ret == EAGAIN) {
ALOGI("role switch busy, retry in %d ms", ROLE_SWAP_RETRY_MS);
std::this_thread::sleep_for(std::chrono::milliseconds(ROLE_SWAP_RETRY_MS));
ret = fputs(convertRoletoString(in_role).c_str(), fp);
}
fclose(fp);
if ((ret != EOF) && ReadFileToString(filename, &written)) {
written = Trim(written);

View file

@ -80,6 +80,7 @@ constexpr char kGadgetName[] = "11210000.dwc3";
#define DISPLAYPORT_IRQ_HPD_COUNT_CHECK 3
#define DISPLAYPORT_POLL_WAIT_MS 100
#define ROLE_SWAP_RETRY_MS 700
#define SVID_DISPLAYPORT "ff01"
#define SVID_THUNDERBOLT "8087"