move proximity sensor code as proposed by Rene Dohmen

This commit is contained in:
Jehan Monnier 2011-04-26 14:47:56 +02:00
parent 18608ce038
commit 6fae63450e
2 changed files with 11 additions and 4 deletions

View file

@ -121,9 +121,7 @@
[[LinphoneManager instance] setCallDelegate:myPhoneViewController];
[[LinphoneManager instance] startLibLinphone];
[ [UIDevice currentDevice] setProximityMonitoringEnabled:true];
return YES;

View file

@ -182,6 +182,9 @@
[hangup setEnabled:false];
[callDuration stop];
UIDevice *device = [UIDevice currentDevice];
device.proximityMonitoringEnabled = NO;
[peerLabel setText:@""];
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"firstlogindone_preference" ] == true) {
@ -192,7 +195,13 @@
}
-(void) displayIncalViewforUser:(NSString*) username withDisplayName:(NSString*) displayName {
[hangup setEnabled:true];
UIDevice *device = [UIDevice currentDevice];
device.proximityMonitoringEnabled = YES;
if (device.proximityMonitoringEnabled == YES) {
ms_message("Ok this device support proximity, and I just enabled it");
}
[hangup setEnabled:true];
if (displayName && [displayName length]>0) {
[peerLabel setText:displayName];
} else {