| 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 19 matching lines...) Expand all Loading... |
| 30 static BuildInfo* New() { | 30 static BuildInfo* New() { |
| 31 return new BuildInfo(AttachCurrentThread()); | 31 return new BuildInfo(AttachCurrentThread()); |
| 32 } | 32 } |
| 33 | 33 |
| 34 static void Delete(BuildInfo* x) { | 34 static void Delete(BuildInfo* x) { |
| 35 // We're leaking this type, see kRegisterAtExit. | 35 // We're leaking this type, see kRegisterAtExit. |
| 36 NOTREACHED(); | 36 NOTREACHED(); |
| 37 } | 37 } |
| 38 | 38 |
| 39 static const bool kRegisterAtExit = false; | 39 static const bool kRegisterAtExit = false; |
| 40 #ifndef NDEBUG |
| 40 static const bool kAllowedToAccessOnNonjoinableThread = true; | 41 static const bool kAllowedToAccessOnNonjoinableThread = true; |
| 42 #endif |
| 41 }; | 43 }; |
| 42 | 44 |
| 43 BuildInfo::BuildInfo(JNIEnv* env) | 45 BuildInfo::BuildInfo(JNIEnv* env) |
| 44 : device_(StrDupJString(Java_BuildInfo_getDevice(env))), | 46 : device_(StrDupJString(Java_BuildInfo_getDevice(env))), |
| 45 model_(StrDupJString(Java_BuildInfo_getDeviceModel(env))), | 47 model_(StrDupJString(Java_BuildInfo_getDeviceModel(env))), |
| 46 brand_(StrDupJString(Java_BuildInfo_getBrand(env))), | 48 brand_(StrDupJString(Java_BuildInfo_getBrand(env))), |
| 47 android_build_id_(StrDupJString(Java_BuildInfo_getAndroidBuildId(env))), | 49 android_build_id_(StrDupJString(Java_BuildInfo_getAndroidBuildId(env))), |
| 48 android_build_fp_(StrDupJString( | 50 android_build_fp_(StrDupJString( |
| 49 Java_BuildInfo_getAndroidBuildFingerprint(env))), | 51 Java_BuildInfo_getAndroidBuildFingerprint(env))), |
| 50 package_version_code_(StrDupJString(Java_BuildInfo_getPackageVersionCode( | 52 package_version_code_(StrDupJString(Java_BuildInfo_getPackageVersionCode( |
| (...skipping 19 matching lines...) Expand all Loading... |
| 70 java_exception_info_ = strndup(info.c_str(), 1024); | 72 java_exception_info_ = strndup(info.c_str(), 1024); |
| 71 } | 73 } |
| 72 | 74 |
| 73 // static | 75 // static |
| 74 bool BuildInfo::RegisterBindings(JNIEnv* env) { | 76 bool BuildInfo::RegisterBindings(JNIEnv* env) { |
| 75 return RegisterNativesImpl(env); | 77 return RegisterNativesImpl(env); |
| 76 } | 78 } |
| 77 | 79 |
| 78 } // namespace android | 80 } // namespace android |
| 79 } // namespace base | 81 } // namespace base |
| OLD | NEW |