mirror of
https://github.com/Evolution-X-Devices/device_xiaomi_stone
synced 2026-01-27 17:18:49 +00:00
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:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user