Chromium Code Reviews| 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 #ifndef BASE_ANDROID_BUILD_INFO_H_ | 5 #ifndef BASE_ANDROID_BUILD_INFO_H_ |
| 6 #define BASE_ANDROID_BUILD_INFO_H_ | 6 #define BASE_ANDROID_BUILD_INFO_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | |
| 11 | 12 |
| 12 #include "base/base_export.h" | 13 #include "base/base_export.h" |
| 13 #include "base/macros.h" | 14 #include "base/macros.h" |
| 14 #include "base/memory/singleton.h" | 15 #include "base/memory/singleton.h" |
| 15 | 16 |
| 16 namespace base { | 17 namespace base { |
| 17 namespace android { | 18 namespace android { |
| 18 | 19 |
| 19 // This enumeration maps to the values returned by BuildInfo::sdk_int(), | 20 // This enumeration maps to the values returned by BuildInfo::sdk_int(), |
| 20 // indicating the Android release associated with a given SDK version. | 21 // indicating the Android release associated with a given SDK version. |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 109 return java_exception_info_; | 110 return java_exception_info_; |
| 110 } | 111 } |
| 111 | 112 |
| 112 void SetJavaExceptionInfo(const std::string& info); | 113 void SetJavaExceptionInfo(const std::string& info); |
| 113 | 114 |
| 114 void ClearJavaExceptionInfo(); | 115 void ClearJavaExceptionInfo(); |
| 115 | 116 |
| 116 private: | 117 private: |
| 117 friend struct BuildInfoSingletonTraits; | 118 friend struct BuildInfoSingletonTraits; |
| 118 | 119 |
| 119 explicit BuildInfo(JNIEnv* env); | 120 explicit BuildInfo(const std::vector<std::string>& params); |
| 120 | 121 |
| 121 // Const char* is used instead of std::strings because these values must be | 122 // Const char* is used instead of std::strings because these values must be |
| 122 // available even if the process is in a crash state. Sadly | 123 // available even if the process is in a crash state. Sadly |
| 123 // std::string.c_str() doesn't guarantee that memory won't be allocated when | 124 // std::string.c_str() doesn't guarantee that memory won't be allocated when |
| 124 // it is called. | 125 // it is called. |
| 126 const char* const brand_; | |
|
agrieve
2017/04/21 17:58:36
re-ordered to match the order on the Java side.
| |
| 125 const char* const device_; | 127 const char* const device_; |
| 128 const char* const android_build_id_; | |
| 126 const char* const manufacturer_; | 129 const char* const manufacturer_; |
| 127 const char* const model_; | 130 const char* const model_; |
| 128 const char* const brand_; | 131 const int sdk_int_; |
| 129 const char* const android_build_id_; | 132 const char* const build_type_; |
| 133 const char* const package_label_; | |
| 134 const char* const package_name_; | |
| 135 const char* const package_version_code_; | |
| 136 const char* const package_version_name_; | |
| 130 const char* const android_build_fp_; | 137 const char* const android_build_fp_; |
| 131 const char* const gms_version_code_; | 138 const char* const gms_version_code_; |
| 132 const char* const package_version_code_; | |
| 133 const char* const package_version_name_; | |
| 134 const char* const package_label_; | |
| 135 const char* const package_name_; | |
| 136 const char* const build_type_; | |
| 137 // Not needed by breakpad. | 139 // Not needed by breakpad. |
| 138 const std::string extracted_file_suffix_; | 140 const std::string extracted_file_suffix_; |
| 139 const int sdk_int_; | |
| 140 // This is set via set_java_exception_info, not at constructor time. | 141 // This is set via set_java_exception_info, not at constructor time. |
| 141 const char* java_exception_info_; | 142 const char* java_exception_info_; |
| 142 | 143 |
| 143 DISALLOW_COPY_AND_ASSIGN(BuildInfo); | 144 DISALLOW_COPY_AND_ASSIGN(BuildInfo); |
| 144 }; | 145 }; |
| 145 | 146 |
| 146 } // namespace android | 147 } // namespace android |
| 147 } // namespace base | 148 } // namespace base |
| 148 | 149 |
| 149 #endif // BASE_ANDROID_BUILD_INFO_H_ | 150 #endif // BASE_ANDROID_BUILD_INFO_H_ |
| OLD | NEW |