1
0
Fork 0

android: init: Parse 'lcd=XXX' in kernel cmdline

Signed-off-by: hmz007 <hmz007@gmail.com>
master
hmz007 1 year ago
parent 2165835b93
commit 9e808dd831

@ -1234,6 +1234,14 @@ static void ProcessKernelCmdline() {
ImportKernelCmdline([&](const std::string& key, const std::string& value) {
if (StartsWith(key, ANDROIDBOOT_PREFIX)) {
InitPropertySet("ro.boot." + key.substr(ANDROIDBOOT_PREFIX.size()), value);
} else if (key == "lcd") {
std::size_t found = value.find_first_of(",");
InitPropertySet("ro.boot.panel", value.substr(0, found));
if (found != std::string::npos) {
auto dpi = std::atoi(value.substr(found + 1).c_str());
if (dpi >= 80 && dpi <= 640)
InitPropertySet("ro.sf.lcd_density", android::base::StringPrintf("%d", dpi));
}
}
});
}

Loading…
Cancel
Save