Commit 770b9d8e authored by guaiyihu's avatar guaiyihu Committed by prady

sdm660: whyred: libinit: Set product model dynamically

Change-Id: I4f67e7025ea2a3b566fd7871e9f86dfa93c79c2a
parent 80f6b2a5
......@@ -94,4 +94,22 @@ void vendor_load_persist_properties()
property_override_dual("ro.product.model", "ro.vendor.product.model", "MI PAD 4");
}
}
if (product.find("whyred") != std::string::npos) {
std::ifstream fin;
std::string buf;
fin.open("/proc/cmdline");
while (std::getline(fin, buf, ' '))
if (buf.find("androidboot.hwc") != std::string::npos)
break;
fin.close();
if (buf.find("CN") != std::string::npos || buf.find("Global") != std::string::npos) {
property_override_dual("ro.product.model", "ro.vendor.product.model", "Redmi Note 5");
} else {
property_override_dual("ro.product.model", "ro.vendor.product.model", "Redmi Note 5 Pro");
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment