Chromium Code Reviews| 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 // This methods returns the hardware version of the device the app is running | |
|
stuartmorgan
2012/07/25 11:48:59
s/This method returns/Returns/
Chen Yu
2012/07/25 12:44:55
Done.
| |
| 14 // on. | |
| 15 // Possible (known) values include: | |
| 16 // iPhone1,1 -> iPhone 1G | |
| 17 // iPhone1,2 -> iPhone 3G | |
| 18 // iPhone2,1 -> iPhone 3GS | |
| 19 // iPhone3,1 -> iPhone 4/AT&T | |
| 20 // iPhone3,2 -> iPhone 4/Other Carrier? | |
| 21 // iPhone3,3 -> iPhone 4/Other Carrier? | |
| 22 // iPhone4,1 -> ??iPhone 5 | |
| 23 // | |
| 24 // iPod1,1 -> iPod touch 1G | |
| 25 // iPod2,1 -> iPod touch 2G | |
| 26 // iPod2,2 -> ??iPod touch 2.5G | |
| 27 // iPod3,1 -> iPod touch 3G | |
| 28 // iPod4,1 -> iPod touch 4G | |
| 29 // iPod5,1 -> ??iPod touch 5G | |
| 30 // | |
| 31 // iPad1,1 -> iPad 1G, WiFi | |
| 32 // iPad1,? -> iPad 1G, 3G <- needs 3G owner to test | |
| 33 // iPad2,1 -> iPad 2G (iProd 2,1) | |
| 34 // | |
| 35 // AppleTV2,1 -> AppleTV 2 | |
| 36 // | |
| 37 // (The returned string is the string returned by sysctlbyname() with name | |
| 38 // "hw.machine".) | |
| 39 std::string GetPlatform(); | |
| 40 | |
| 41 // Returns true if the application is running on a high-ram device. (>=250M). | |
| 42 bool IsRunningOnHighRamDevice(); | |
| 43 | |
| 44 // Returns true if the device has only one core. | |
| 45 bool IsSingleCoreDevice(); | |
| 46 | |
| 47 // Returns the first MAC address. | |
| 48 std::string GetMacAddress(std::string ifName); | |
| 49 | |
| 50 // Returns a random UUID. | |
| 51 std::string GetRandomId(); | |
| 52 | |
| 53 // Returns an identifier for the device, using the given |salt|. A global | |
| 54 // identifier is generated the first time this method is called, and the salt | |
| 55 // is used to be able to generate distinct identifiers for the same device. If | |
| 56 // |salt| is NULL, a default value is used. Unless you are using this value for | |
| 57 // something that should be anonymous, you should probably pass NULL. | |
| 58 std::string GetDeviceIdentifier(const char* const salt); | |
| 59 | |
| 60 } // namespace device_util | |
| 61 } // namespace ios | |
| 62 | |
| 63 #endif // BASE_IOS_DEVICE_UTIL_H_ | |
| OLD | NEW |