Skip to content

Commit

Permalink
Make CPU model determination failure non-fatal.
Browse files Browse the repository at this point in the history
- Always log errors if device info fails for some reason.
- Don't fail if reading ro.boot.hardware.platform fails.
  • Loading branch information
pmuetschard committed Apr 20, 2020
1 parent 878cc29 commit 99a0099
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 2 additions & 4 deletions core/os/device/deviceinfo/cc/cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,9 @@ bool query::queryCpu(CpuInfo* info, std::string* error) {

if (info->name == "") {
char str[PROP_VALUE_MAX];
if (__system_property_get("ro.boot.hardware.platform", str) == 0) {
error->append("Failed reading ro.boot.hardware.platform property");
return false;
if (__system_property_get("ro.boot.hardware.platform", str) != 0) {
info->name = str;
}
info->name = str;
}

info->vendor = "ARM"; // TODO: get the implementer?
Expand Down
2 changes: 2 additions & 0 deletions core/os/device/deviceinfo/cc/instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

#include "instance.h"
#include "core/cc/log.h"
#include "query.h"

namespace {
Expand All @@ -34,6 +35,7 @@ device_instance get_device_instance() {
error.clear();
auto instance = query::getDeviceInstance(query_opt, &error);
if (!instance) {
GAPID_ERROR("Failed to query device info: %s", error.c_str());
return out;
}

Expand Down

0 comments on commit 99a0099

Please sign in to comment.