@@ -72,6 +72,7 @@ public void onPairingRequired(ConnectableDevice device, DeviceService service, P
72
72
break ;
73
73
74
74
case PIN_CODE :
75
+ case MIXED :
75
76
Log .d ("2ndScreenAPP" , "Pin Code" );
76
77
pairingCodeDialog .show ();
77
78
break ;
@@ -90,10 +91,13 @@ public void onConnectionFailed(ConnectableDevice device, ServiceCommandError err
90
91
91
92
@ Override
92
93
public void onDeviceReady (ConnectableDevice device ) {
94
+ Log .d ("2ndScreenAPP" , "onPairingSuccess" );
93
95
if (pairingAlertDialog .isShowing ()) {
94
- Log .d ("2ndScreenAPP" , "onPairingSuccess" );
95
96
pairingAlertDialog .dismiss ();
96
97
}
98
+ if (pairingCodeDialog .isShowing ()) {
99
+ pairingCodeDialog .dismiss ();
100
+ }
97
101
registerSuccess (mTV );
98
102
}
99
103
@@ -214,6 +218,7 @@ public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
214
218
215
219
mTV = (ConnectableDevice )arg0 .getItemAtPosition (arg2 );
216
220
mTV .addListener (deviceListener );
221
+ mTV .setPairingType (null );
217
222
mTV .connect ();
218
223
connectItem .setTitle (mTV .getFriendlyName ());
219
224
@@ -297,6 +302,9 @@ void connectEnded(ConnectableDevice device) {
297
302
if (pairingAlertDialog .isShowing ()) {
298
303
pairingAlertDialog .dismiss ();
299
304
}
305
+ if (pairingCodeDialog .isShowing ()) {
306
+ pairingCodeDialog .dismiss ();
307
+ }
300
308
mTV .removeListener (deviceListener );
301
309
mTV = null ;
302
310
}
0 commit comments