| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 return java_exception_info_; | 111 return java_exception_info_; |
| 111 } | 112 } |
| 112 | 113 |
| 113 void SetJavaExceptionInfo(const std::string& info); | 114 void SetJavaExceptionInfo(const std::string& info); |
| 114 | 115 |
| 115 void ClearJavaExceptionInfo(); | 116 void ClearJavaExceptionInfo(); |
| 116 | 117 |
| 117 private: | 118 private: |
| 118 friend struct BuildInfoSingletonTraits; | 119 friend struct BuildInfoSingletonTraits; |
| 119 | 120 |
| 120 explicit BuildInfo(JNIEnv* env); | 121 explicit BuildInfo(const std::vector<std::string>& params); |
| 121 | 122 |
| 122 // Const char* is used instead of std::strings because these values must be | 123 // Const char* is used instead of std::strings because these values must be |
| 123 // available even if the process is in a crash state. Sadly | 124 // available even if the process is in a crash state. Sadly |
| 124 // std::string.c_str() doesn't guarantee that memory won't be allocated when | 125 // std::string.c_str() doesn't guarantee that memory won't be allocated when |
| 125 // it is called. | 126 // it is called. |
| 127 const char* const brand_; |
| 126 const char* const device_; | 128 const char* const device_; |
| 129 const char* const android_build_id_; |
| 127 const char* const manufacturer_; | 130 const char* const manufacturer_; |
| 128 const char* const model_; | 131 const char* const model_; |
| 129 const char* const brand_; | 132 const int sdk_int_; |
| 130 const char* const android_build_id_; | 133 const char* const build_type_; |
| 134 const char* const package_label_; |
| 135 const char* const package_name_; |
| 136 const char* const package_version_code_; |
| 137 const char* const package_version_name_; |
| 131 const char* const android_build_fp_; | 138 const char* const android_build_fp_; |
| 132 const char* const gms_version_code_; | 139 const char* const gms_version_code_; |
| 133 const char* const package_version_code_; | |
| 134 const char* const package_version_name_; | |
| 135 const char* const package_label_; | |
| 136 const char* const package_name_; | |
| 137 const char* const build_type_; | |
| 138 // Not needed by breakpad. | 140 // Not needed by breakpad. |
| 139 const std::string extracted_file_suffix_; | 141 const std::string extracted_file_suffix_; |
| 140 const int sdk_int_; | |
| 141 // This is set via set_java_exception_info, not at constructor time. | 142 // This is set via set_java_exception_info, not at constructor time. |
| 142 const char* java_exception_info_; | 143 const char* java_exception_info_; |
| 143 | 144 |
| 144 DISALLOW_COPY_AND_ASSIGN(BuildInfo); | 145 DISALLOW_COPY_AND_ASSIGN(BuildInfo); |
| 145 }; | 146 }; |
| 146 | 147 |
| 147 } // namespace android | 148 } // namespace android |
| 148 } // namespace base | 149 } // namespace base |
| 149 | 150 |
| 150 #endif // BASE_ANDROID_BUILD_INFO_H_ | 151 #endif // BASE_ANDROID_BUILD_INFO_H_ |
| OLD | NEW |