| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/ui/android/android_about_app_info.h" |
| 6 |
| 7 #include <string> |
| 8 |
| 9 #include "base/stringprintf.h" |
| 10 #include "base/sys_info.h" |
| 11 |
| 12 namespace about_android_app { |
| 13 |
| 14 std::string GetOsInfo() { |
| 15 std::string android_info_str; |
| 16 |
| 17 // Append information about the OS version. |
| 18 int32 os_major_version = 0; |
| 19 int32 os_minor_version = 0; |
| 20 int32 os_bugfix_version = 0; |
| 21 base::SysInfo::OperatingSystemVersionNumbers(&os_major_version, |
| 22 &os_minor_version, |
| 23 &os_bugfix_version); |
| 24 base::StringAppendF(&android_info_str, "%d.%d.%d", os_major_version, |
| 25 os_minor_version, os_bugfix_version); |
| 26 |
| 27 // Append information about the device. |
| 28 bool semicolon_inserted = false; |
| 29 std::string android_build_codename = base::SysInfo::GetAndroidBuildCodename(); |
| 30 std::string android_device_name = base::SysInfo::GetDeviceName(); |
| 31 if ("REL" == android_build_codename && android_device_name.size() > 0) { |
| 32 android_info_str += "; " + android_device_name; |
| 33 semicolon_inserted = true; |
| 34 } |
| 35 |
| 36 // Append the build ID. |
| 37 std::string android_build_id = base::SysInfo::GetAndroidBuildID(); |
| 38 if (android_build_id.size() > 0) { |
| 39 if (!semicolon_inserted) { |
| 40 android_info_str += ";"; |
| 41 } |
| 42 android_info_str += " Build/" + android_build_id; |
| 43 } |
| 44 |
| 45 return android_info_str; |
| 46 } |
| 47 |
| 48 } // namespace about_android_app |
| OLD | NEW |