OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef BASE_IOS_DEVICE_UTIL_H_ | |
6 #define BASE_IOS_DEVICE_UTIL_H_ | |
7 | |
8 #include <string> | |
9 | |
10 namespace ios { | |
11 namespace device_util { | |
12 | |
13 // Returns the hardware version of the device the app is running on. | |
14 // Possible (known) values include: | |
15 // iPhone1,1 -> iPhone 1G | |
16 // iPhone1,2 -> iPhone 3G | |
17 // iPhone2,1 -> iPhone 3GS | |
18 // iPhone3,1 -> iPhone 4/AT&T | |
19 // iPhone3,2 -> iPhone 4/Other Carrier? | |
20 // iPhone3,3 -> iPhone 4/Other Carrier? | |
21 // iPhone4,1 -> ??iPhone 5 | |
Mark Mentovai
2012/07/25 14:00:23
There’s no such thing yet, right? “?” is a good en
Chen Yu
2012/07/27 16:28:17
Done.
| |
22 // | |
23 // iPod1,1 -> iPod touch 1G | |
24 // iPod2,1 -> iPod touch 2G | |
25 // iPod2,2 -> ??iPod touch 2.5G | |
26 // iPod3,1 -> iPod touch 3G | |
27 // iPod4,1 -> iPod touch 4G | |
28 // iPod5,1 -> ??iPod touch 5G | |
Mark Mentovai
2012/07/25 14:00:23
Same.
Chen Yu
2012/07/27 16:28:17
Done.
| |
29 // | |
30 // iPad1,1 -> iPad 1G, WiFi | |
31 // iPad1,? -> iPad 1G, 3G <- needs 3G owner to test | |
32 // iPad2,1 -> iPad 2G (iProd 2,1) | |
Mark Mentovai
2012/07/25 14:00:23
What does iProd mean?
Chen Yu
2012/07/27 16:28:17
fixed.
On 2012/07/25 14:00:23, Mark Mentovai wrote
| |
33 // | |
34 // AppleTV2,1 -> AppleTV 2 | |
Mark Mentovai
2012/07/25 14:00:23
What’s it return on a simulator? Just the Mac mode
Chen Yu
2012/07/27 16:28:17
Added
On 2012/07/25 14:00:23, Mark Mentovai wrote:
| |
35 // | |
36 // (The returned string is the string returned by sysctlbyname() with name | |
37 // "hw.machine".) | |
38 std::string GetPlatform(); | |
39 | |
40 // Returns true if the application is running on a high-ram device. (>=250M). | |
41 bool IsRunningOnHighRamDevice(); | |
42 | |
43 // Returns true if the device has only one core. | |
44 bool IsSingleCoreDevice(); | |
45 | |
46 // Returns the first MAC address. | |
Mark Mentovai
2012/07/25 14:00:23
This doesn’t explain why this function needs an ar
Chen Yu
2012/07/27 16:28:17
Done.
| |
47 std::string GetMacAddress(std::string ifName); | |
Mark Mentovai
2012/07/25 14:00:23
ifName should not use camelCase. Also, don’t abbre
Mark Mentovai
2012/07/25 14:00:23
The argument type should be const std::string&. No
Chen Yu
2012/07/27 16:28:17
Done.
Chen Yu
2012/07/27 16:28:17
Done.
| |
48 | |
49 // Returns a random UUID. | |
50 std::string GetRandomId(); | |
51 | |
52 // Returns an identifier for the device, using the given |salt|. A global | |
53 // identifier is generated the first time this method is called, and the salt | |
54 // is used to be able to generate distinct identifiers for the same device. If | |
55 // |salt| is NULL, a default value is used. Unless you are using this value for | |
56 // something that should be anonymous, you should probably pass NULL. | |
57 std::string GetDeviceIdentifier(const char* const salt); | |
58 | |
59 } // namespace device_util | |
60 } // namespace ios | |
61 | |
62 #endif // BASE_IOS_DEVICE_UTIL_H_ | |
OLD | NEW |