mirror of
https://github.com/Evolution-X-Devices/device_google_gs201
synced 2026-01-27 09:39:39 +00:00
Snap for 11973804 from cb51a640f4 to 24Q3-release
Change-Id: I28d9b5204972734074d7a8b2d33d62774504a024
This commit is contained in:
@@ -602,6 +602,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);
|
||||
|
||||
@@ -56,6 +56,8 @@ constexpr char kGadgetName[] = "11210000.dwc3";
|
||||
#define VBUS_PATH NEW_UDC_PATH "dwc3_exynos_otg_b_sess"
|
||||
#define USB_DATA_PATH NEW_UDC_PATH "usb_data_enabled"
|
||||
|
||||
#define ROLE_SWAP_RETRY_MS 700
|
||||
|
||||
struct Usb : public BnUsb {
|
||||
Usb();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user