Skip to content

Commit

Permalink
Try a few more properties to get a CPU name.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmuetschard committed Apr 20, 2020
1 parent 99a0099 commit f3c0f79
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions core/os/device/deviceinfo/cc/cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,19 @@ bool query::queryCpu(CpuInfo* info, std::string* error) {
}

if (info->name == "") {
static const char* cpuProps[] = {
"ro.boot.hardware.platform",
"ro.hardware.chipname",
"ro.boot.hardware",
"ro.hardware",
"ro.arch",
};
char str[PROP_VALUE_MAX];
if (__system_property_get("ro.boot.hardware.platform", str) != 0) {
info->name = str;
for (const char* prop : cpuProps) {
if (__system_property_get(prop, str) != 0) {
info->name = str;
break;
}
}
}

Expand Down

0 comments on commit f3c0f79

Please sign in to comment.