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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 #include <sys/system_properties.h> | 10 #include <sys/system_properties.h> |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 } | 55 } |
56 | 56 |
57 #endif | 57 #endif |
58 | 58 |
59 namespace { | 59 namespace { |
60 | 60 |
61 // Default version of Android to fall back to when actual version numbers | 61 // Default version of Android to fall back to when actual version numbers |
62 // cannot be acquired. Use the latest Android release with a higher bug fix | 62 // cannot be acquired. Use the latest Android release with a higher bug fix |
63 // version to avoid unnecessarily comparison errors with the latest release. | 63 // version to avoid unnecessarily comparison errors with the latest release. |
64 // This should be manually kept up to date on each Android release. | 64 // This should be manually kept up to date on each Android release. |
65 const int kDefaultAndroidMajorVersion = 6; | 65 const int kDefaultAndroidMajorVersion = 7; |
66 const int kDefaultAndroidMinorVersion = 0; | 66 const int kDefaultAndroidMinorVersion = 0; |
67 const int kDefaultAndroidBugfixVersion = 99; | 67 const int kDefaultAndroidBugfixVersion = 99; |
68 | 68 |
69 // Parse out the OS version numbers from the system properties. | 69 // Parse out the OS version numbers from the system properties. |
70 void ParseOSVersionNumbers(const char* os_version_str, | 70 void ParseOSVersionNumbers(const char* os_version_str, |
71 int32_t* major_version, | 71 int32_t* major_version, |
72 int32_t* minor_version, | 72 int32_t* minor_version, |
73 int32_t* bugfix_version) { | 73 int32_t* bugfix_version) { |
74 if (os_version_str[0]) { | 74 if (os_version_str[0]) { |
75 // Try to parse out the version numbers from the string. | 75 // Try to parse out the version numbers from the string. |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 // implementations which could give different results. | 225 // implementations which could give different results. |
226 // Also the Java code cannot depend on the native code | 226 // Also the Java code cannot depend on the native code |
227 // since it might not be loaded yet. | 227 // since it might not be loaded yet. |
228 if (!base::android::IsVMInitialized()) | 228 if (!base::android::IsVMInitialized()) |
229 return false; | 229 return false; |
230 return g_lazy_low_end_device.Get().value(); | 230 return g_lazy_low_end_device.Get().value(); |
231 } | 231 } |
232 | 232 |
233 | 233 |
234 } // namespace base | 234 } // namespace base |
OLD | NEW |