summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsaac Chen <isaacchen@isaacchen.cn>2018-03-10 16:58:30 +0100
committerIsaac Chen <isaacchen@isaacchen.cn>2018-07-13 00:03:44 +0000
commitf05bd896e3e7a50950b5dbd80e957cc0db30fc67 (patch)
tree9df5f8b26dbcf01f7a8e0240b0d01d39defdc83d
parent25b47ac236e89800524f57b8176fe91d30d87f2d (diff)
wayne: Set model via checking hardware revision
Signed-off-by: Isaac Chen <isaacchen@isaacchen.cn>
-rw-r--r--init/init_wayne.cpp23
-rw-r--r--lineage.mk4
2 files changed, 26 insertions, 1 deletions
diff --git a/init/init_wayne.cpp b/init/init_wayne.cpp
index 4964568..4fccce4 100644
--- a/init/init_wayne.cpp
+++ b/init/init_wayne.cpp
@@ -76,6 +76,28 @@ static void init_finger_print_properties()
}
}
+static void init_setup_model_properties()
+{
+ std::ifstream fin;
+ std::string buf;
+
+ std::string product = GetProperty("ro.product.name", "");
+ if (product.find("wayne") == std::string::npos)
+ return;
+
+ fin.open("/proc/cmdline");
+ while (std::getline(fin, buf, ' '))
+ if (buf.find("hwversion") != std::string::npos)
+ break;
+ fin.close();
+
+ if (buf.find("2.31.0") != std::string::npos) {
+ property_set("ro.product.model", "MI 6X MIKU");
+ } else {
+ property_set("ro.product.model", "MI 6X");
+ }
+}
+
static void init_alarm_boot_properties()
{
char const *boot_reason_file = "/proc/sys/kernel/boot_reason";
@@ -138,6 +160,7 @@ void vendor_load_properties()
init_alarm_boot_properties();
check_device();
init_finger_print_properties();
+ init_setup_model_properties();
property_set("dalvik.vm.heapstartsize", heapstartsize);
property_set("dalvik.vm.heapgrowthlimit", heapgrowthlimit);
diff --git a/lineage.mk b/lineage.mk
index 8c6d042..8be4023 100644
--- a/lineage.mk
+++ b/lineage.mk
@@ -28,7 +28,6 @@ PRODUCT_BRAND := Xiaomi
PRODUCT_DEVICE := wayne
PRODUCT_MANUFACTURER := Xiaomi
PRODUCT_NAME := lineage_wayne
-PRODUCT_MODEL := MI 6X
PRODUCT_GMS_CLIENTID_BASE := android-xiaomi
@@ -38,3 +37,6 @@ PRODUCT_BUILD_PROP_OVERRIDES += \
PRIVATE_BUILD_DESC="wayne-user 8.1.0 OPM1.171019.011 V9.5.11.0.ODCCNFA release-keys"
BUILD_FINGERPRINT := xiaomi/wayne/wayne:8.1.0/OPM1.171019.011/V9.5.11.0.ODCCNFA:user/release-keys
+
+PRODUCT_SYSTEM_PROPERTY_BLACKLIST += \
+ ro.product.model