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
* but it also hardcodes fingerprints based on region, we can recreate the same effect by using the region prop ro.boot.hwc

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

View File

@@ -11,8 +11,8 @@
#include <vector>
typedef struct variant_info {
std::string hwc_value;
std::string model_value;
std::string sku_value;
std::string brand;
std::string device;

View File

@@ -12,16 +12,17 @@
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.model_value == "" || variant.model_value == model_value) &&
(variant.sku_value == "" || variant.sku_value == sku_value)) {
if ((variant.hwc_value == "" || variant.hwc_value == hwc_value) &&
(variant.model_value == "" || variant.model_value == model_value)) {
set_variant_props(variant);
break;
}