clover: libinit: Set product model dynamically
Change-Id: I6ac3931cab7301551098d077a7bb60d3760d8d98
This commit is contained in:
parent
33d078f66f
commit
3c6bab5243
1 changed files with 10 additions and 0 deletions
|
@ -88,8 +88,11 @@ static void init_alarm_boot_properties()
|
|||
|
||||
void vendor_load_properties()
|
||||
{
|
||||
std::string platform;
|
||||
std::string hw_device;
|
||||
|
||||
char const *hw_id_file = "/sys/devices/platform/HardwareInfo/hw_id";
|
||||
|
||||
hw_device = GetProperty("ro.board.variant", "");
|
||||
if (hw_device.compare("d9")) {
|
||||
property_set ( "ro.vendor.product.model", "MI PAD 4");
|
||||
|
@ -97,5 +100,12 @@ void vendor_load_properties()
|
|||
property_set ( "ro.vendor.product.model", "MI PAD 4 PLUS");
|
||||
}
|
||||
|
||||
ReadFileToString(hw_id_file, &hw_device);
|
||||
if (hw_device.find("D9P") != std::string::npos) {
|
||||
property_override_dual("ro.product.model", "ro.vendor.product.model", "MI PAD 4 PLUS");
|
||||
} else {
|
||||
property_override_dual("ro.product.model", "ro.vendor.product.model", "MI PAD 4");
|
||||
}
|
||||
|
||||
init_alarm_boot_properties();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue