| OLD | NEW |
| 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 <jni.h> |
| 7 #include <stdint.h> | 8 #include <stdint.h> |
| 8 | 9 |
| 9 #include <string> | 10 #include <string> |
| 10 | 11 |
| 12 #include "base/android/jni_android.h" |
| 13 #include "base/android/jni_string.h" |
| 11 #include "base/strings/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
| 12 #include "base/sys_info.h" | 15 #include "base/sys_info.h" |
| 16 #include "jni/ChromeVersionInfo_jni.h" |
| 17 |
| 18 std::string AndroidAboutAppInfo::GetGmsInfo() { |
| 19 JNIEnv* env = base::android::AttachCurrentThread(); |
| 20 const base::android::ScopedJavaLocalRef<jstring> info = |
| 21 Java_ChromeVersionInfo_getGmsInfo(env); |
| 22 return base::android::ConvertJavaStringToUTF8(env, info); |
| 23 } |
| 13 | 24 |
| 14 std::string AndroidAboutAppInfo::GetOsInfo() { | 25 std::string AndroidAboutAppInfo::GetOsInfo() { |
| 15 std::string android_info_str; | 26 std::string android_info_str; |
| 16 | 27 |
| 17 // Append information about the OS version. | 28 // Append information about the OS version. |
| 18 int32_t os_major_version = 0; | 29 int32_t os_major_version = 0; |
| 19 int32_t os_minor_version = 0; | 30 int32_t os_minor_version = 0; |
| 20 int32_t os_bugfix_version = 0; | 31 int32_t os_bugfix_version = 0; |
| 21 base::SysInfo::OperatingSystemVersionNumbers(&os_major_version, | 32 base::SysInfo::OperatingSystemVersionNumbers(&os_major_version, |
| 22 &os_minor_version, | 33 &os_minor_version, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 37 std::string android_build_id = base::SysInfo::GetAndroidBuildID(); | 48 std::string android_build_id = base::SysInfo::GetAndroidBuildID(); |
| 38 if (android_build_id.size() > 0) { | 49 if (android_build_id.size() > 0) { |
| 39 if (!semicolon_inserted) { | 50 if (!semicolon_inserted) { |
| 40 android_info_str += ";"; | 51 android_info_str += ";"; |
| 41 } | 52 } |
| 42 android_info_str += " Build/" + android_build_id; | 53 android_info_str += " Build/" + android_build_id; |
| 43 } | 54 } |
| 44 | 55 |
| 45 return android_info_str; | 56 return android_info_str; |
| 46 } | 57 } |
| OLD | NEW |