Avoid connecting the device again when the device is already connected
Test: manual Bug: 192621487 Change-Id: I520c137b2553748aa2a03f3ea8c40f339f2af44e
This commit is contained in:
committed by
Jenhou (Alan) Huang
parent
f63d69c9b6
commit
38c191d6c6
@@ -171,8 +171,8 @@ public class LocalMediaManager implements BluetoothCallback {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (device == mCurrentConnectedDevice) {
|
if (device.equals(mCurrentConnectedDevice)) {
|
||||||
Log.d(TAG, "connectDevice() this device all ready connected! : " + device.getName());
|
Log.d(TAG, "connectDevice() this device is already connected! : " + device.getName());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -198,7 +198,10 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter {
|
|||||||
if (mController.isTransferring()) {
|
if (mController.isTransferring()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (isCurrentlyConnected(device)) {
|
||||||
|
Log.d(TAG, "This device is already connected! : " + device.getName());
|
||||||
|
return;
|
||||||
|
}
|
||||||
mCurrentActivePosition = -1;
|
mCurrentActivePosition = -1;
|
||||||
playSwitchingAnim(mConnectedItem, view);
|
playSwitchingAnim(mConnectedItem, view);
|
||||||
mController.connectDevice(device);
|
mController.connectDevice(device);
|
||||||
|
|||||||
Reference in New Issue
Block a user