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> |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 const char* package_version_name() const { | 62 const char* package_version_name() const { |
63 return package_version_name_; | 63 return package_version_name_; |
64 } | 64 } |
65 | 65 |
66 const char* java_exception_info() const { | 66 const char* java_exception_info() const { |
67 return java_exception_info_; | 67 return java_exception_info_; |
68 } | 68 } |
69 | 69 |
70 void set_java_exception_info(const std::string& info); | 70 void set_java_exception_info(const std::string& info); |
71 | 71 |
| 72 static bool RegisterBindings(JNIEnv* env); |
| 73 |
72 private: | 74 private: |
73 friend struct BuildInfoSingletonTraits; | 75 friend struct BuildInfoSingletonTraits; |
74 | 76 |
75 explicit BuildInfo(JNIEnv* env); | 77 explicit BuildInfo(JNIEnv* env); |
76 | 78 |
77 // Const char* is used instead of std::strings because these values must be | 79 // Const char* is used instead of std::strings because these values must be |
78 // available even if the process is in a crash state. Sadly | 80 // available even if the process is in a crash state. Sadly |
79 // std::string.c_str() doesn't guarantee that memory won't be allocated when | 81 // std::string.c_str() doesn't guarantee that memory won't be allocated when |
80 // it is called. | 82 // it is called. |
81 const char* const device_; | 83 const char* const device_; |
82 const char* const model_; | 84 const char* const model_; |
83 const char* const brand_; | 85 const char* const brand_; |
84 const char* const android_build_id_; | 86 const char* const android_build_id_; |
85 const char* const android_build_fp_; | 87 const char* const android_build_fp_; |
86 const char* const package_version_code_; | 88 const char* const package_version_code_; |
87 const char* const package_version_name_; | 89 const char* const package_version_name_; |
88 // This is set via set_java_exception_info, not at constructor time. | 90 // This is set via set_java_exception_info, not at constructor time. |
89 const char* java_exception_info_; | 91 const char* java_exception_info_; |
90 | 92 |
91 DISALLOW_COPY_AND_ASSIGN(BuildInfo); | 93 DISALLOW_COPY_AND_ASSIGN(BuildInfo); |
92 }; | 94 }; |
93 | 95 |
94 bool RegisterBuildInfo(JNIEnv* env); | |
95 | |
96 } // namespace android | 96 } // namespace android |
97 } // namespace base | 97 } // namespace base |
98 | 98 |
99 #endif // BASE_ANDROID_BUILD_INFO_H_ | 99 #endif // BASE_ANDROID_BUILD_INFO_H_ |
OLD | NEW |