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 "base/android/build_info.h" | 5 #include "base/android/build_info.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 package_version_code_(StrDupJString(Java_BuildInfo_getPackageVersionCode( | 53 package_version_code_(StrDupJString(Java_BuildInfo_getPackageVersionCode( |
54 env, GetApplicationContext()))), | 54 env, GetApplicationContext()))), |
55 package_version_name_(StrDupJString(Java_BuildInfo_getPackageVersionName( | 55 package_version_name_(StrDupJString(Java_BuildInfo_getPackageVersionName( |
56 env, GetApplicationContext()))), | 56 env, GetApplicationContext()))), |
57 package_label_(StrDupJString(Java_BuildInfo_getPackageLabel( | 57 package_label_(StrDupJString(Java_BuildInfo_getPackageLabel( |
58 env, GetApplicationContext()))), | 58 env, GetApplicationContext()))), |
59 package_name_(StrDupJString(Java_BuildInfo_getPackageName( | 59 package_name_(StrDupJString(Java_BuildInfo_getPackageName( |
60 env, GetApplicationContext()))), | 60 env, GetApplicationContext()))), |
61 build_type_(StrDupJString(Java_BuildInfo_getBuildType(env))), | 61 build_type_(StrDupJString(Java_BuildInfo_getBuildType(env))), |
62 sdk_int_(Java_BuildInfo_getSdkInt(env)), | 62 sdk_int_(Java_BuildInfo_getSdkInt(env)), |
63 has_apk_splits_(Java_BuildInfo_hasApkSplits( | 63 has_language_apk_splits_(Java_BuildInfo_hasLanguageApkSplits( |
64 env, GetApplicationContext())), | 64 env, GetApplicationContext())), |
65 java_exception_info_(NULL) { | 65 java_exception_info_(NULL) { |
66 } | 66 } |
67 | 67 |
68 // static | 68 // static |
69 BuildInfo* BuildInfo::GetInstance() { | 69 BuildInfo* BuildInfo::GetInstance() { |
70 return Singleton<BuildInfo, BuildInfoSingletonTraits >::get(); | 70 return Singleton<BuildInfo, BuildInfoSingletonTraits >::get(); |
71 } | 71 } |
72 | 72 |
73 void BuildInfo::SetJavaExceptionInfo(const std::string& info) { | 73 void BuildInfo::SetJavaExceptionInfo(const std::string& info) { |
74 DCHECK(!java_exception_info_) << "info should be set only once."; | 74 DCHECK(!java_exception_info_) << "info should be set only once."; |
75 java_exception_info_ = strndup(info.c_str(), 4096); | 75 java_exception_info_ = strndup(info.c_str(), 4096); |
76 } | 76 } |
77 | 77 |
78 void BuildInfo::ClearJavaExceptionInfo() { | 78 void BuildInfo::ClearJavaExceptionInfo() { |
79 delete java_exception_info_; | 79 delete java_exception_info_; |
80 java_exception_info_ = nullptr; | 80 java_exception_info_ = nullptr; |
81 } | 81 } |
82 | 82 |
83 // static | 83 // static |
84 bool BuildInfo::RegisterBindings(JNIEnv* env) { | 84 bool BuildInfo::RegisterBindings(JNIEnv* env) { |
85 return RegisterNativesImpl(env); | 85 return RegisterNativesImpl(env); |
86 } | 86 } |
87 | 87 |
88 } // namespace android | 88 } // namespace android |
89 } // namespace base | 89 } // namespace base |
OLD | NEW |