Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(954)

Side by Side Diff: base/android/build_info.cc

Issue 1641513004: Update //base to chromium 9659b08ea5a34f889dc4166217f438095ddc10d2 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/android/build_info.h ('k') | base/android/cxa_demangle_stub.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 30 matching lines...) Expand all
41 static const bool kAllowedToAccessOnNonjoinableThread = true; 41 static const bool kAllowedToAccessOnNonjoinableThread = true;
42 #endif 42 #endif
43 }; 43 };
44 44
45 BuildInfo::BuildInfo(JNIEnv* env) 45 BuildInfo::BuildInfo(JNIEnv* env)
46 : device_(StrDupJString(Java_BuildInfo_getDevice(env))), 46 : device_(StrDupJString(Java_BuildInfo_getDevice(env))),
47 manufacturer_(StrDupJString(Java_BuildInfo_getDeviceManufacturer(env))), 47 manufacturer_(StrDupJString(Java_BuildInfo_getDeviceManufacturer(env))),
48 model_(StrDupJString(Java_BuildInfo_getDeviceModel(env))), 48 model_(StrDupJString(Java_BuildInfo_getDeviceModel(env))),
49 brand_(StrDupJString(Java_BuildInfo_getBrand(env))), 49 brand_(StrDupJString(Java_BuildInfo_getBrand(env))),
50 android_build_id_(StrDupJString(Java_BuildInfo_getAndroidBuildId(env))), 50 android_build_id_(StrDupJString(Java_BuildInfo_getAndroidBuildId(env))),
51 android_build_fp_(StrDupJString( 51 android_build_fp_(
52 Java_BuildInfo_getAndroidBuildFingerprint(env))), 52 StrDupJString(Java_BuildInfo_getAndroidBuildFingerprint(env))),
53 package_version_code_(StrDupJString(Java_BuildInfo_getPackageVersionCode( 53 package_version_code_(StrDupJString(
54 env, GetApplicationContext()))), 54 Java_BuildInfo_getPackageVersionCode(env, GetApplicationContext()))),
55 package_version_name_(StrDupJString(Java_BuildInfo_getPackageVersionName( 55 package_version_name_(StrDupJString(
56 env, GetApplicationContext()))), 56 Java_BuildInfo_getPackageVersionName(env, GetApplicationContext()))),
57 package_label_(StrDupJString(Java_BuildInfo_getPackageLabel( 57 package_label_(StrDupJString(
58 env, GetApplicationContext()))), 58 Java_BuildInfo_getPackageLabel(env, GetApplicationContext()))),
59 package_name_(StrDupJString(Java_BuildInfo_getPackageName( 59 package_name_(StrDupJString(
60 env, GetApplicationContext()))), 60 Java_BuildInfo_getPackageName(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 java_exception_info_(NULL) { 63 has_language_apk_splits_(
64 } 64 Java_BuildInfo_hasLanguageApkSplits(env, GetApplicationContext())),
65 java_exception_info_(NULL) {}
65 66
66 // static 67 // static
67 BuildInfo* BuildInfo::GetInstance() { 68 BuildInfo* BuildInfo::GetInstance() {
68 return Singleton<BuildInfo, BuildInfoSingletonTraits >::get(); 69 return Singleton<BuildInfo, BuildInfoSingletonTraits >::get();
69 } 70 }
70 71
71 void BuildInfo::SetJavaExceptionInfo(const std::string& info) { 72 void BuildInfo::SetJavaExceptionInfo(const std::string& info) {
72 DCHECK(!java_exception_info_) << "info should be set only once."; 73 DCHECK(!java_exception_info_) << "info should be set only once.";
73 java_exception_info_ = strndup(info.c_str(), 4096); 74 java_exception_info_ = strndup(info.c_str(), 4096);
74 } 75 }
75 76
76 void BuildInfo::ClearJavaExceptionInfo() { 77 void BuildInfo::ClearJavaExceptionInfo() {
77 delete java_exception_info_; 78 delete java_exception_info_;
78 java_exception_info_ = nullptr; 79 java_exception_info_ = nullptr;
79 } 80 }
80 81
81 // static 82 // static
82 bool BuildInfo::RegisterBindings(JNIEnv* env) { 83 bool BuildInfo::RegisterBindings(JNIEnv* env) {
83 return RegisterNativesImpl(env); 84 return RegisterNativesImpl(env);
84 } 85 }
85 86
86 } // namespace android 87 } // namespace android
87 } // namespace base 88 } // namespace base
OLDNEW
« no previous file with comments | « base/android/build_info.h ('k') | base/android/cxa_demangle_stub.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698