| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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. |
| 61 // This should be manually kept up-to-date on each Android release. | 61 // This should be manually kept up-to-date on each Android release. |
| 62 const int kDefaultAndroidMajorVersion = 4; | 62 const int kDefaultAndroidMajorVersion = 5; |
| 63 const int kDefaultAndroidMinorVersion = 4; | 63 const int kDefaultAndroidMinorVersion = 0; |
| 64 const int kDefaultAndroidBugfixVersion = 99; | 64 const int kDefaultAndroidBugfixVersion = 99; |
| 65 | 65 |
| 66 // Parse out the OS version numbers from the system properties. | 66 // Parse out the OS version numbers from the system properties. |
| 67 void ParseOSVersionNumbers(const char* os_version_str, | 67 void ParseOSVersionNumbers(const char* os_version_str, |
| 68 int32 *major_version, | 68 int32 *major_version, |
| 69 int32 *minor_version, | 69 int32 *minor_version, |
| 70 int32 *bugfix_version) { | 70 int32 *bugfix_version) { |
| 71 if (os_version_str[0]) { | 71 if (os_version_str[0]) { |
| 72 // Try to parse out the version numbers from the string. | 72 // Try to parse out the version numbers from the string. |
| 73 int num_read = sscanf(os_version_str, "%d.%d.%d", major_version, | 73 int num_read = sscanf(os_version_str, "%d.%d.%d", major_version, |
| (...skipping 135 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 |