sm6375-common: libinit: Adjust detection prop to better suite xiaomi sm6375 devices

* Xiaomi devices on SM6375 platform use ro.boot.board_id to identify different SKU's, let's mirror miui in that

Change-Id: I00dd84979db6066ad18bc36b619795de751925f8
This commit is contained in:
Ramii Ahmed
2022-04-01 19:23:33 +00:00
parent b19e0e95ee
commit cef224fbc4
2 changed files with 6 additions and 4 deletions

View File

@@ -11,13 +11,14 @@
#include <vector>
typedef struct variant_info {
std::string hwc_value;
std::string model_value;
std::string sku_value;
std::string brand;
std::string device;
std::string marketname;
std::string model;
std::string name;
std::string build_fingerprint;
bool nfc;

View File

@@ -11,15 +11,15 @@
using android::base::GetProperty;
#define HWC_PROP "ro.boot.hwc"
#define MODEL_PROP "ro.boot.board_id"
#define SKU_PROP "ro.boot.product.hardware.sku"
void search_variant(const std::vector<variant_info_t> variants) {
std::string hwc_value = GetProperty(HWC_PROP, "");
std::string model_value = GetProperty(MODEL_PROP, "");
std::string sku_value = GetProperty(SKU_PROP, "");
for (const auto& variant : variants) {
if ((variant.hwc_value == "" || variant.hwc_value == hwc_value) &&
if ((variant.model_value == "" || variant.model_value == model_value) &&
(variant.sku_value == "" || variant.sku_value == sku_value)) {
set_variant_props(variant);
break;
@@ -32,6 +32,7 @@ void set_variant_props(const variant_info_t variant) {
set_ro_build_prop("device", variant.device, true);
set_ro_build_prop("marketname", variant.marketname, true);
set_ro_build_prop("model", variant.model, true);
set_ro_build_prop("name", variant.name, true);
set_ro_build_prop("fingerprint", variant.build_fingerprint);
property_override("ro.bootimage.build.fingerprint", variant.build_fingerprint);