forked from mirrors/linphone-iphone
better management of proximity sensor
This commit is contained in:
parent
c936537b36
commit
e165252d3c
2 changed files with 3 additions and 4 deletions
|
|
@ -154,7 +154,6 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
[self previewTouchLift];
|
||||
// Enable tap
|
||||
[singleFingerTap setEnabled:TRUE];
|
||||
[[UIDevice currentDevice] setProximityMonitoringEnabled:!_speakerButton.enabled];
|
||||
|
||||
[NSNotificationCenter.defaultCenter addObserver:self
|
||||
selector:@selector(messageReceived:)
|
||||
|
|
@ -180,7 +179,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
[super viewDidAppear:animated];
|
||||
|
||||
[[UIApplication sharedApplication] setIdleTimerDisabled:YES];
|
||||
UIDevice.currentDevice.proximityMonitoringEnabled = YES;
|
||||
UIDevice.currentDevice.proximityMonitoringEnabled = !_speakerButton.enabled;
|
||||
|
||||
[PhoneMainView.instance setVolumeHidden:TRUE];
|
||||
hiddenVolume = TRUE;
|
||||
|
|
@ -212,7 +211,6 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
videoDismissTimer = nil;
|
||||
}
|
||||
|
||||
[[UIDevice currentDevice] setProximityMonitoringEnabled:FALSE];
|
||||
// Remove observer
|
||||
[NSNotificationCenter.defaultCenter removeObserver:self];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -817,6 +817,7 @@ static void linphone_iphone_display_status(struct _LinphoneCore *lc, const char
|
|||
|
||||
// Disable speaker when no more call
|
||||
if ((state == LinphoneCallEnd || state == LinphoneCallError)) {
|
||||
[[UIDevice currentDevice] setProximityMonitoringEnabled:FALSE];
|
||||
speaker_already_enabled = FALSE;
|
||||
if (linphone_core_get_calls_nb(theLinphoneCore) == 0) {
|
||||
[self setSpeakerEnabled:FALSE];
|
||||
|
|
@ -2600,7 +2601,7 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) {
|
|||
} else {
|
||||
AVAudioSessionPortDescription *builtinPort = [AudioHelper builtinAudioDevice];
|
||||
[[AVAudioSession sharedInstance] setPreferredInput:builtinPort error:&err];
|
||||
[[UIDevice currentDevice] setProximityMonitoringEnabled:TRUE];
|
||||
[[UIDevice currentDevice] setProximityMonitoringEnabled:(linphone_core_get_calls_nb(LC) > 0)];
|
||||
}
|
||||
|
||||
if (err) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue