mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-09 14:06:33 +00:00
ios: Get simulator device model correctly.
Use SIMULATOR_MODEL_IDENTIFIER to get the equivalent device model. Bug: crashpad:31 Change-Id: I17950d77c214533614781a5ca41170d6c3a77ae3 Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2726978 Commit-Queue: Justin Cohen <justincohen@chromium.org> Reviewed-by: Mark Mentovai <mark@chromium.org>
This commit is contained in:
parent
8cdc852a9e
commit
9a7c3beeef
@ -23,6 +23,7 @@
|
||||
|
||||
#include "base/mac/mach_logging.h"
|
||||
#include "base/numerics/safe_conversions.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "base/strings/sys_string_conversions.h"
|
||||
#include "build/build_config.h"
|
||||
|
||||
@ -84,17 +85,21 @@ IOSSystemDataCollector::IOSSystemDataCollector()
|
||||
// TODO(justincohen): Consider adding board and model information to
|
||||
// |machine_description| as well (similar to MacModelAndBoard in
|
||||
// util/mac/mac_util.cc).
|
||||
const char* model = getenv("SIMULATOR_MODEL_IDENTIFIER");
|
||||
if (model == nullptr) {
|
||||
switch (UI_USER_INTERFACE_IDIOM()) {
|
||||
case UIUserInterfaceIdiomPhone:
|
||||
machine_description_ = "iOS Simulator (iPhone)";
|
||||
model = "iPhone";
|
||||
break;
|
||||
case UIUserInterfaceIdiomPad:
|
||||
machine_description_ = "iOS Simulator (iPad)";
|
||||
model = "iPad";
|
||||
break;
|
||||
default:
|
||||
machine_description_ = "iOS Simulator (Unknown)";
|
||||
model = "Unknown";
|
||||
break;
|
||||
}
|
||||
}
|
||||
machine_description_ = base::StringPrintf("iOS Simulator (%s)", model);
|
||||
#elif TARGET_OS_IPHONE
|
||||
utsname uts;
|
||||
if (uname(&uts) == 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user