3636import androidx .constraintlayout .widget .ConstraintLayout ;
3737import androidx .fragment .app .Fragment ;
3838
39+ import com .bluetooth .communicator .tools .Timer ;
3940import com .bluetooth .communicatorexample .Global ;
4041import com .bluetooth .communicatorexample .MainActivity ;
4142import com .bluetooth .communicatorexample .R ;
4748import com .bluetooth .communicatorexample .tools .Tools ;
4849import com .bluetooth .communicator .BluetoothCommunicator ;
4950import com .bluetooth .communicator .Peer ;
50- import com .bluetooth .communicator .connection .Channel ;
51- import com .bluetooth .communicator .connection .client .BluetoothConnectionClient ;
5251
5352import java .text .DateFormat ;
5453import java .util .ArrayList ;
@@ -62,7 +61,7 @@ public class PairingFragment extends Fragment {
6261 private ConstraintLayout constraintLayout ;
6362 private Peer confirmConnectionPeer ;
6463 private ListView listViewGui ;
65- private Channel . Timer connectionTimer ;
64+ private Timer connectionTimer ;
6665 @ Nullable
6766 private PeerListAdapter listView ;
6867 private TextView discoveryDescription ;
@@ -139,7 +138,7 @@ public void onConnectionSuccess(Peer peer, int source) {
139138 public void onConnectionFailed (Peer peer , int errorCode ) {
140139 super .onConnectionFailed (peer , errorCode );
141140 if (connectingPeer != null ) {
142- if (connectionTimer != null && !connectionTimer .isFinished () && errorCode != BluetoothConnectionClient .CONNECTION_REJECTED ) {
141+ if (connectionTimer != null && !connectionTimer .isFinished () && errorCode != BluetoothCommunicator .CONNECTION_REJECTED ) {
143142 // the timer has not expired and the connection has not been refused, so we try again
144143 activity .connect (peer );
145144 } else {
@@ -149,7 +148,7 @@ public void onConnectionFailed(Peer peer, int errorCode) {
149148 activateInputs ();
150149 disappearLoading (true , null );
151150 connectingPeer = null ;
152- if (errorCode == BluetoothConnectionClient .CONNECTION_REJECTED ) {
151+ if (errorCode == BluetoothCommunicator .CONNECTION_REJECTED ) {
153152 Toast .makeText (activity , peer .getName () + " refused the connection request" , Toast .LENGTH_SHORT ).show ();
154153 } else {
155154 Toast .makeText (activity , "Connection error" , Toast .LENGTH_SHORT ).show ();
@@ -399,7 +398,7 @@ public RequestDialog getConnectionConfirmDialog() {
399398 }
400399
401400 private void startConnectionTimer () {
402- connectionTimer = new Channel . Timer (CONNECTION_TIMEOUT );
401+ connectionTimer = new Timer (CONNECTION_TIMEOUT );
403402 connectionTimer .start ();
404403 }
405404
0 commit comments