Merge changes from topic "presubmit-am-eb743dcef6874f73b81d4e42bb9d33ba" into sc-v2-dev-plus-aosp

* changes:
  [automerge] Avoid connecting the device again when the device is already connected 2p: 38c191d6c6
  Avoid connecting the device again when the device is already connected
This commit is contained in:
TreeHugger Robot
2022-02-08 09:57:45 +00:00
committed by Android (Google) Code Review
2 changed files with 6 additions and 3 deletions

View File

@@ -172,8 +172,8 @@ public class LocalMediaManager implements BluetoothCallback {
}
}
if (device == mCurrentConnectedDevice) {
Log.d(TAG, "connectDevice() this device all ready connected! : " + device.getName());
if (device.equals(mCurrentConnectedDevice)) {
Log.d(TAG, "connectDevice() this device is already connected! : " + device.getName());
return false;
}

View File

@@ -198,7 +198,10 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter {
if (mController.isTransferring()) {
return;
}
if (isCurrentlyConnected(device)) {
Log.d(TAG, "This device is already connected! : " + device.getName());
return;
}
mCurrentActivePosition = -1;
playSwitchingAnim(mConnectedItem, view);
mController.connectDevice(device);