|
|
@ -7,8 +7,6 @@
|
|
|
|
#import "CallAudioManager.h"
|
|
|
|
#import "CallAudioManager.h"
|
|
|
|
#import "PhoneManager.h"
|
|
|
|
#import "PhoneManager.h"
|
|
|
|
|
|
|
|
|
|
|
|
#import <MediaPlayer/MPMusicPlayerController.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define BUTTON_BORDER_WIDTH 1.0f
|
|
|
|
#define BUTTON_BORDER_WIDTH 1.0f
|
|
|
|
#define CONTACT_IMAGE_BORDER_WIDTH 2.0f
|
|
|
|
#define CONTACT_IMAGE_BORDER_WIDTH 2.0f
|
|
|
|
#define RINGING_ROTATION_DURATION 0.375f
|
|
|
|
#define RINGING_ROTATION_DURATION 0.375f
|
|
|
@ -24,7 +22,6 @@ static NSInteger connectingFlashCounter = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@interface InCallViewController () {
|
|
|
|
@interface InCallViewController () {
|
|
|
|
BOOL _isMusicPaused;
|
|
|
|
|
|
|
|
CallAudioManager *_callAudioManager;
|
|
|
|
CallAudioManager *_callAudioManager;
|
|
|
|
NSTimer *_connectingFlashTimer;
|
|
|
|
NSTimer *_connectingFlashTimer;
|
|
|
|
NSTimer *_ringingAnimationTimer;
|
|
|
|
NSTimer *_ringingAnimationTimer;
|
|
|
@ -47,7 +44,6 @@ static NSInteger connectingFlashCounter = 0;
|
|
|
|
- (void)viewDidLoad {
|
|
|
|
- (void)viewDidLoad {
|
|
|
|
[super viewDidLoad];
|
|
|
|
[super viewDidLoad];
|
|
|
|
[self showCallState];
|
|
|
|
[self showCallState];
|
|
|
|
[self pauseMusicIfPlaying];
|
|
|
|
|
|
|
|
[self setupButtonBorders];
|
|
|
|
[self setupButtonBorders];
|
|
|
|
[self localizeButtons];
|
|
|
|
[self localizeButtons];
|
|
|
|
[UIDevice.currentDevice setProximityMonitoringEnabled:YES];
|
|
|
|
[UIDevice.currentDevice setProximityMonitoringEnabled:YES];
|
|
|
@ -75,13 +71,6 @@ static NSInteger connectingFlashCounter = 0;
|
|
|
|
[self handleIncomingDetails];
|
|
|
|
[self handleIncomingDetails];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
- (void)pauseMusicIfPlaying {
|
|
|
|
|
|
|
|
if ([[MPMusicPlayerController iPodMusicPlayer] playbackState] == MPMusicPlaybackStatePlaying) {
|
|
|
|
|
|
|
|
_isMusicPaused = YES;
|
|
|
|
|
|
|
|
[[MPMusicPlayerController iPodMusicPlayer] pause];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- (void)startConnectingFlashAnimation {
|
|
|
|
- (void)startConnectingFlashAnimation {
|
|
|
|
if(!_ringingAnimationTimer.isValid){
|
|
|
|
if(!_ringingAnimationTimer.isValid){
|
|
|
|
_connectingFlashTimer = [NSTimer scheduledTimerWithTimeInterval:CONNECTING_FLASH_DURATION
|
|
|
|
_connectingFlashTimer = [NSTimer scheduledTimerWithTimeInterval:CONNECTING_FLASH_DURATION
|
|
|
@ -207,7 +196,7 @@ static NSInteger connectingFlashCounter = 0;
|
|
|
|
BOOL showAcceptRejectButtons = !_callState.initiatedLocally && [latestProgress type] <= CallProgressType_Ringing;
|
|
|
|
BOOL showAcceptRejectButtons = !_callState.initiatedLocally && [latestProgress type] <= CallProgressType_Ringing;
|
|
|
|
[self displayAcceptRejectButtons:showAcceptRejectButtons];
|
|
|
|
[self displayAcceptRejectButtons:showAcceptRejectButtons];
|
|
|
|
[AppAudioManager.sharedInstance respondToProgressChange:[latestProgress type]
|
|
|
|
[AppAudioManager.sharedInstance respondToProgressChange:[latestProgress type]
|
|
|
|
forLocallyInitiatedCall:_callState.initiatedLocally];
|
|
|
|
forLocallyInitiatedCall:_callState.initiatedLocally];
|
|
|
|
|
|
|
|
|
|
|
|
if ([latestProgress type] == CallProgressType_Ringing) {
|
|
|
|
if ([latestProgress type] == CallProgressType_Ringing) {
|
|
|
|
[self startRingingAnimation];
|
|
|
|
[self startRingingAnimation];
|
|
|
@ -228,10 +217,6 @@ static NSInteger connectingFlashCounter = 0;
|
|
|
|
[Environment.phoneManager hangupOrDenyCall];
|
|
|
|
[Environment.phoneManager hangupOrDenyCall];
|
|
|
|
|
|
|
|
|
|
|
|
[self dismissViewWithOptionalDelay: [termination type] != CallTerminationType_ReplacedByNext ];
|
|
|
|
[self dismissViewWithOptionalDelay: [termination type] != CallTerminationType_ReplacedByNext ];
|
|
|
|
|
|
|
|
|
|
|
|
if (_isMusicPaused) {
|
|
|
|
|
|
|
|
[[MPMusicPlayerController iPodMusicPlayer] play];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
- (void)endCallTapped {
|
|
|
|
- (void)endCallTapped {
|
|
|
|