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/mac/mach_logging.h"
|
||||||
#include "base/numerics/safe_conversions.h"
|
#include "base/numerics/safe_conversions.h"
|
||||||
|
#include "base/strings/stringprintf.h"
|
||||||
#include "base/strings/sys_string_conversions.h"
|
#include "base/strings/sys_string_conversions.h"
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
|
|
||||||
@ -84,17 +85,21 @@ IOSSystemDataCollector::IOSSystemDataCollector()
|
|||||||
// TODO(justincohen): Consider adding board and model information to
|
// TODO(justincohen): Consider adding board and model information to
|
||||||
// |machine_description| as well (similar to MacModelAndBoard in
|
// |machine_description| as well (similar to MacModelAndBoard in
|
||||||
// util/mac/mac_util.cc).
|
// util/mac/mac_util.cc).
|
||||||
switch (UI_USER_INTERFACE_IDIOM()) {
|
const char* model = getenv("SIMULATOR_MODEL_IDENTIFIER");
|
||||||
case UIUserInterfaceIdiomPhone:
|
if (model == nullptr) {
|
||||||
machine_description_ = "iOS Simulator (iPhone)";
|
switch (UI_USER_INTERFACE_IDIOM()) {
|
||||||
break;
|
case UIUserInterfaceIdiomPhone:
|
||||||
case UIUserInterfaceIdiomPad:
|
model = "iPhone";
|
||||||
machine_description_ = "iOS Simulator (iPad)";
|
break;
|
||||||
break;
|
case UIUserInterfaceIdiomPad:
|
||||||
default:
|
model = "iPad";
|
||||||
machine_description_ = "iOS Simulator (Unknown)";
|
break;
|
||||||
break;
|
default:
|
||||||
|
model = "Unknown";
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
machine_description_ = base::StringPrintf("iOS Simulator (%s)", model);
|
||||||
#elif TARGET_OS_IPHONE
|
#elif TARGET_OS_IPHONE
|
||||||
utsname uts;
|
utsname uts;
|
||||||
if (uname(&uts) == 0) {
|
if (uname(&uts) == 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user