| 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/sys_info.h" | 5 #include "base/sys_info.h" |
| 6 | 6 |
| 7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
| 8 #include <sys/system_properties.h> | 8 #include <sys/system_properties.h> |
| 9 | 9 |
| 10 #include "base/android/sys_utils.h" | 10 #include "base/android/sys_utils.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 SystemPropertyGetFunction*, DynamicallyLoadRealSystemPropertyGet> >::Leaky | 40 SystemPropertyGetFunction*, DynamicallyLoadRealSystemPropertyGet> >::Leaky |
| 41 g_lazy_real_system_property_get = LAZY_INSTANCE_INITIALIZER; | 41 g_lazy_real_system_property_get = LAZY_INSTANCE_INITIALIZER; |
| 42 | 42 |
| 43 } // namespace | 43 } // namespace |
| 44 | 44 |
| 45 // Android 'L' removes __system_property_get from the NDK, however it is still | 45 // Android 'L' removes __system_property_get from the NDK, however it is still |
| 46 // a hidden symbol in libc. Until we remove all calls of __system_property_get | 46 // a hidden symbol in libc. Until we remove all calls of __system_property_get |
| 47 // from Chrome we work around this by defining a weak stub here, which uses | 47 // from Chrome we work around this by defining a weak stub here, which uses |
| 48 // dlsym to but ensures that Chrome uses the real system | 48 // dlsym to but ensures that Chrome uses the real system |
| 49 // implementatation when loaded. http://crbug.com/392191. | 49 // implementatation when loaded. http://crbug.com/392191. |
| 50 int __system_property_get(const char* name, char* value) { | 50 BASE_EXPORT int __system_property_get(const char* name, char* value) { |
| 51 return g_lazy_real_system_property_get.Get().value()(name, value); | 51 return g_lazy_real_system_property_get.Get().value()(name, value); |
| 52 } | 52 } |
| 53 | 53 |
| 54 #endif | 54 #endif |
| 55 | 55 |
| 56 namespace { | 56 namespace { |
| 57 | 57 |
| 58 // Default version of Android to fall back to when actual version numbers | 58 // Default version of Android to fall back to when actual version numbers |
| 59 // cannot be acquired. Use the latest Android release with a higher bug fix | 59 // cannot be acquired. Use the latest Android release with a higher bug fix |
| 60 // version to avoid unnecessarily comparison errors with the latest release. | 60 // version to avoid unnecessarily comparison errors with the latest release. |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 base::internal::LazySysInfoValue<bool, | 209 base::internal::LazySysInfoValue<bool, |
| 210 android::SysUtils::IsLowEndDeviceFromJni> >::Leaky | 210 android::SysUtils::IsLowEndDeviceFromJni> >::Leaky |
| 211 g_lazy_low_end_device = LAZY_INSTANCE_INITIALIZER; | 211 g_lazy_low_end_device = LAZY_INSTANCE_INITIALIZER; |
| 212 | 212 |
| 213 bool SysInfo::IsLowEndDevice() { | 213 bool SysInfo::IsLowEndDevice() { |
| 214 return g_lazy_low_end_device.Get().value(); | 214 return g_lazy_low_end_device.Get().value(); |
| 215 } | 215 } |
| 216 | 216 |
| 217 | 217 |
| 218 } // namespace base | 218 } // namespace base |
| OLD | NEW |