Skip to content

Commit

Permalink
Added Vibration support flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Erica Sadun committed Mar 5, 2009
1 parent 8b076c6 commit f651a1c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion UIDevice-hardware.h
Expand Up @@ -23,7 +23,8 @@ enum {
UIDeviceBuiltInCamera = 1 << 2,
UIDeviceBuiltInMicrophone = 1 << 3,
UIDeviceSupportsExternalMicrophone = 1 << 4,
UIDeviceSupportsTelephony = 1 << 5
UIDeviceSupportsTelephony = 1 << 5,
UIDeviceSupportsVibration = 1 << 6
};

@interface UIDevice (Hardware)
Expand Down
12 changes: 8 additions & 4 deletions UIDevice-hardware.m
@@ -1,4 +1,8 @@
/* Thanks to Emanuele Vulcano, Kevin Ballard/Eridius */
/* Thanks to Emanuele Vulcano, Kevin Ballard/Eridius, Ryandjohnson */

/*
- Bluetooth? Screen pixels? Dot pitch? Accelerometer? GPS disabled in Egypt (and others?). - @halm
*/

#import "UIDevice-hardware.h"
#include <sys/types.h>
Expand Down Expand Up @@ -57,9 +61,9 @@ - (int) platformCapabilities
{
switch ([self platformType])
{
case UIDevice1GiPhone: return UIDeviceBuiltInSpeaker | UIDeviceBuiltInCamera | UIDeviceBuiltInMicrophone | UIDeviceSupportsExternalMicrophone | UIDeviceSupportsTelephony;
case UIDevice3GiPhone: return UIDeviceSupportsGPS | UIDeviceBuiltInSpeaker | UIDeviceBuiltInCamera | UIDeviceBuiltInMicrophone | UIDeviceSupportsExternalMicrophone | UIDeviceSupportsTelephony;
case UIDeviceUnknowniPhone: return UIDeviceBuiltInSpeaker | UIDeviceBuiltInCamera | UIDeviceBuiltInMicrophone | UIDeviceSupportsExternalMicrophone | UIDeviceSupportsTelephony;
case UIDevice1GiPhone: return UIDeviceBuiltInSpeaker | UIDeviceBuiltInCamera | UIDeviceBuiltInMicrophone | UIDeviceSupportsExternalMicrophone | UIDeviceSupportsTelephony | UIDeviceSupportsVibration;
case UIDevice3GiPhone: return UIDeviceSupportsGPS | UIDeviceBuiltInSpeaker | UIDeviceBuiltInCamera | UIDeviceBuiltInMicrophone | UIDeviceSupportsExternalMicrophone | UIDeviceSupportsTelephony | UIDeviceSupportsVibration;
case UIDeviceUnknowniPhone: return UIDeviceBuiltInSpeaker | UIDeviceBuiltInCamera | UIDeviceBuiltInMicrophone | UIDeviceSupportsExternalMicrophone | UIDeviceSupportsTelephony | UIDeviceSupportsVibration;

case UIDevice1GiPod: return 0;
case UIDevice2GiPod: return UIDeviceBuiltInSpeaker | UIDeviceBuiltInMicrophone | UIDeviceSupportsExternalMicrophone;
Expand Down

0 comments on commit f651a1c

Please sign in to comment.