@ -29,6 +29,7 @@ import org.thoughtcrime.redphone.util.AudioUtils;
 
			
		
	
		
		
			
				
					
					import  org.thoughtcrime.redphone.util.UncaughtExceptionHandlerManager ; import  org.thoughtcrime.redphone.util.UncaughtExceptionHandlerManager ;  
			
		
	
		
		
			
				
					
					import  org.thoughtcrime.securesms.ApplicationContext ; import  org.thoughtcrime.securesms.ApplicationContext ;  
			
		
	
		
		
			
				
					
					import  org.thoughtcrime.securesms.WebRtcCallActivity ; import  org.thoughtcrime.securesms.WebRtcCallActivity ;  
			
		
	
		
		
			
				
					
					import  org.thoughtcrime.securesms.contacts.ContactAccessor ;  
			
		
	
		
		
			
				
					
					import  org.thoughtcrime.securesms.database.DatabaseFactory ; import  org.thoughtcrime.securesms.database.DatabaseFactory ;  
			
		
	
		
		
			
				
					
					import  org.thoughtcrime.securesms.dependencies.InjectableType ; import  org.thoughtcrime.securesms.dependencies.InjectableType ;  
			
		
	
		
		
			
				
					
					import  org.thoughtcrime.securesms.dependencies.SignalCommunicationModule.SignalMessageSenderFactory ; import  org.thoughtcrime.securesms.dependencies.SignalCommunicationModule.SignalMessageSenderFactory ;  
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
						
					 
					@ -40,6 +41,7 @@ import org.thoughtcrime.securesms.recipients.Recipients;
 
			
		
	
		
		
			
				
					
					import  org.thoughtcrime.securesms.util.FutureTaskListener ; import  org.thoughtcrime.securesms.util.FutureTaskListener ;  
			
		
	
		
		
			
				
					
					import  org.thoughtcrime.securesms.util.ListenableFutureTask ; import  org.thoughtcrime.securesms.util.ListenableFutureTask ;  
			
		
	
		
		
			
				
					
					import  org.thoughtcrime.securesms.util.ServiceUtil ; import  org.thoughtcrime.securesms.util.ServiceUtil ;  
			
		
	
		
		
			
				
					
					import  org.thoughtcrime.securesms.util.TextSecurePreferences ;  
			
		
	
		
		
			
				
					
					import  org.thoughtcrime.securesms.util.Util ; import  org.thoughtcrime.securesms.util.Util ;  
			
		
	
		
		
			
				
					
					import  org.thoughtcrime.securesms.webrtc.CallNotificationManager ; import  org.thoughtcrime.securesms.webrtc.CallNotificationManager ;  
			
		
	
		
		
			
				
					
					import  org.thoughtcrime.securesms.webrtc.PeerConnectionFactoryOptions ; import  org.thoughtcrime.securesms.webrtc.PeerConnectionFactoryOptions ;  
			
		
	
	
		
		
			
				
					
						
							
								 
						
						
							
								 
						
						
					 
					@ -279,7 +281,10 @@ public class WebRtcCallService extends Service implements InjectableType, PeerCo
 
			
		
	
		
		
			
				
					
					      @Override 
      @Override 
 
			
		
	
		
		
			
				
					
					      public  void  onSuccessContinue ( List < PeerConnection . IceServer >  result )  { 
      public  void  onSuccessContinue ( List < PeerConnection . IceServer >  result )  { 
 
			
		
	
		
		
			
				
					
					        try  { 
        try  { 
 
			
		
	
		
		
			
				
					
					          WebRtcCallService . this . peerConnection  =  new  PeerConnectionWrapper ( WebRtcCallService . this ,  peerConnectionFactory ,  WebRtcCallService . this ,  localRenderer ,  result ) ; 
          boolean  isSystemContact  =  ContactAccessor . getInstance ( ) . isSystemContact ( WebRtcCallService . this ,  recipient . getNumber ( ) ) ; 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					          boolean  isAlwaysTurn     =  TextSecurePreferences . isTurnOnly ( WebRtcCallService . this ) ; 
 
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					          WebRtcCallService . this . peerConnection  =  new  PeerConnectionWrapper ( WebRtcCallService . this ,  peerConnectionFactory ,  WebRtcCallService . this ,  localRenderer ,  result ,  ! isSystemContact  | |  isAlwaysTurn ) ; 
 
			
		
	
		
		
			
				
					
					          WebRtcCallService . this . peerConnection . setRemoteDescription ( new  SessionDescription ( SessionDescription . Type . OFFER ,  offer ) ) ; 
          WebRtcCallService . this . peerConnection . setRemoteDescription ( new  SessionDescription ( SessionDescription . Type . OFFER ,  offer ) ) ; 
 
			
		
	
		
		
			
				
					
					          WebRtcCallService . this . lockManager . updatePhoneState ( LockManager . PhoneState . PROCESSING ) ; 
          WebRtcCallService . this . lockManager . updatePhoneState ( LockManager . PhoneState . PROCESSING ) ; 
 
			
		
	
		
		
			
				
					
					
 
			
		
	
	
		
		
			
				
					
						
							
								 
						
						
							
								 
						
						
					 
					@ -330,7 +335,9 @@ public class WebRtcCallService extends Service implements InjectableType, PeerCo
 
			
		
	
		
		
			
				
					
					        @Override 
        @Override 
 
			
		
	
		
		
			
				
					
					        public  void  onSuccessContinue ( List < PeerConnection . IceServer >  result )  { 
        public  void  onSuccessContinue ( List < PeerConnection . IceServer >  result )  { 
 
			
		
	
		
		
			
				
					
					          try  { 
          try  { 
 
			
		
	
		
		
			
				
					
					            WebRtcCallService . this . peerConnection  =  new  PeerConnectionWrapper ( WebRtcCallService . this ,  peerConnectionFactory ,  WebRtcCallService . this ,  localRenderer ,  result ) ; 
            boolean  isAlwaysTurn  =  TextSecurePreferences . isTurnOnly ( WebRtcCallService . this ) ; 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					            WebRtcCallService . this . peerConnection  =  new  PeerConnectionWrapper ( WebRtcCallService . this ,  peerConnectionFactory ,  WebRtcCallService . this ,  localRenderer ,  result ,  isAlwaysTurn ) ; 
 
			
		
	
		
		
			
				
					
					            WebRtcCallService . this . dataChannel     =  WebRtcCallService . this . peerConnection . createDataChannel ( DATA_CHANNEL_NAME ) ; 
            WebRtcCallService . this . dataChannel     =  WebRtcCallService . this . peerConnection . createDataChannel ( DATA_CHANNEL_NAME ) ; 
 
			
		
	
		
		
			
				
					
					            WebRtcCallService . this . dataChannel . registerObserver ( WebRtcCallService . this ) ; 
            WebRtcCallService . this . dataChannel . registerObserver ( WebRtcCallService . this ) ;