mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-26 23:58:17 +00:00
add proximity sensor support
This commit is contained in:
parent
a0d959dd3a
commit
29bbdeea75
2 changed files with 4 additions and 0 deletions
|
|
@ -154,6 +154,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
[self previewTouchLift];
|
||||
// Enable tap
|
||||
[singleFingerTap setEnabled:TRUE];
|
||||
[[UIDevice currentDevice] setProximityMonitoringEnabled:!_speakerButton.enabled];
|
||||
|
||||
[NSNotificationCenter.defaultCenter addObserver:self
|
||||
selector:@selector(messageReceived:)
|
||||
|
|
@ -211,6 +212,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
videoDismissTimer = nil;
|
||||
}
|
||||
|
||||
[[UIDevice currentDevice] setProximityMonitoringEnabled:FALSE];
|
||||
// Remove observer
|
||||
[NSNotificationCenter.defaultCenter removeObserver:self];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2600,10 +2600,12 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) {
|
|||
|
||||
if (enable && [self allowSpeaker]) {
|
||||
[[AVAudioSession sharedInstance] overrideOutputAudioPort:AVAudioSessionPortOverrideSpeaker error:&err];
|
||||
[[UIDevice currentDevice] setProximityMonitoringEnabled:FALSE];
|
||||
_bluetoothEnabled = FALSE;
|
||||
} else {
|
||||
AVAudioSessionPortDescription *builtinPort = [AudioHelper builtinAudioDevice];
|
||||
[[AVAudioSession sharedInstance] setPreferredInput:builtinPort error:&err];
|
||||
[[UIDevice currentDevice] setProximityMonitoringEnabled:TRUE];
|
||||
}
|
||||
|
||||
if (err) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue