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

Commit a2f2d88c authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 9451931 from 990ff7ba to udc-release

Change-Id: I02ff664795ff090932cbadd0c9cca777d43237f8
parents c99233e3 990ff7ba
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -319,10 +319,11 @@ static InputDeviceCountryCode readCountryCodeLocked(const std::filesystem::path&
    std::string str;
    if (base::ReadFileToString(sysfsRootPath / "country", &str)) {
        hidCountryCode = std::stoi(str, nullptr, 16);
        LOG_ALWAYS_FATAL_IF(hidCountryCode > 35 || hidCountryCode < 0,
                            "HID country code should be in range [0, 35]. Found country code "
                            "to be %d",
                            hidCountryCode);
        if (hidCountryCode > 35 || hidCountryCode < 0) {
            ALOGE("HID country code should be in range [0, 35], but for sysfs path %s it was %d",
                  sysfsRootPath.c_str(), hidCountryCode);
            return InputDeviceCountryCode::INVALID;
        }
    }

    return static_cast<InputDeviceCountryCode>(hidCountryCode);