Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Side by Side Diff: chrome/browser/ui/android/android_about_app_info.cc

Issue 1234543003: Report Android Build.MODEL in SystemProfileProto hardware_class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address jdduke's comments. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/android/android_about_app_info.h" 5 #include "chrome/browser/ui/android/android_about_app_info.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/sys_info.h" 10 #include "base/sys_info.h"
11 11
12 std::string AndroidAboutAppInfo::GetOsInfo() { 12 std::string AndroidAboutAppInfo::GetOsInfo() {
13 std::string android_info_str; 13 std::string android_info_str;
14 14
15 // Append information about the OS version. 15 // Append information about the OS version.
16 int32 os_major_version = 0; 16 int32 os_major_version = 0;
17 int32 os_minor_version = 0; 17 int32 os_minor_version = 0;
18 int32 os_bugfix_version = 0; 18 int32 os_bugfix_version = 0;
19 base::SysInfo::OperatingSystemVersionNumbers(&os_major_version, 19 base::SysInfo::OperatingSystemVersionNumbers(&os_major_version,
20 &os_minor_version, 20 &os_minor_version,
21 &os_bugfix_version); 21 &os_bugfix_version);
22 base::StringAppendF(&android_info_str, "%d.%d.%d", os_major_version, 22 base::StringAppendF(&android_info_str, "%d.%d.%d", os_major_version,
23 os_minor_version, os_bugfix_version); 23 os_minor_version, os_bugfix_version);
24 24
25 // Append information about the device. 25 // Append information about the device.
26 bool semicolon_inserted = false; 26 bool semicolon_inserted = false;
27 std::string android_build_codename = base::SysInfo::GetAndroidBuildCodename(); 27 std::string android_build_codename = base::SysInfo::GetAndroidBuildCodename();
28 std::string android_device_name = base::SysInfo::GetDeviceName(); 28 std::string android_device_name = base::SysInfo::HardwareModelName();
29 if ("REL" == android_build_codename && android_device_name.size() > 0) { 29 if ("REL" == android_build_codename && android_device_name.size() > 0) {
30 android_info_str += "; " + android_device_name; 30 android_info_str += "; " + android_device_name;
31 semicolon_inserted = true; 31 semicolon_inserted = true;
32 } 32 }
33 33
34 // Append the build ID. 34 // Append the build ID.
35 std::string android_build_id = base::SysInfo::GetAndroidBuildID(); 35 std::string android_build_id = base::SysInfo::GetAndroidBuildID();
36 if (android_build_id.size() > 0) { 36 if (android_build_id.size() > 0) {
37 if (!semicolon_inserted) { 37 if (!semicolon_inserted) {
38 android_info_str += ";"; 38 android_info_str += ";";
39 } 39 }
40 android_info_str += " Build/" + android_build_id; 40 android_info_str += " Build/" + android_build_id;
41 } 41 }
42 42
43 return android_info_str; 43 return android_info_str;
44 } 44 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698