Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5980327b authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5130385 from 3f75c5b7 to pi-qpr2-release

Change-Id: I4c1de53f26b7ec12b51f01cf3e548330ae3a3760
parents 0f940b6e 3f75c5b7
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -597,14 +597,20 @@ public class BluetoothRouteManager extends StateMachine {

        String actualAddress = matchingDevice.isPresent()
                ? address : getActiveDeviceAddress();
        if (actualAddress == null) {
            Log.i(this, "No device specified and BT stack has no active device."
                    + " Using arbitrary device");
            if (deviceList.size() > 0) {
                actualAddress = deviceList.iterator().next().getAddress();
            } else {
                Log.i(this, "No devices available at all. Not connecting.");
                return null;
            }
        }
        if (!matchingDevice.isPresent()) {
            Log.i(this, "No device with address %s available. Using %s instead.",
                    address, actualAddress);
        }
        if (actualAddress == null) {
            Log.i(this, "No device specified and BT stack has no active device. Not connecting.");
            return null;
        }
        if (!connectAudio(actualAddress)) {
            boolean shouldRetry = retryCount < MAX_CONNECTION_RETRIES;
            Log.w(LOG_TAG, "Could not connect to %s. Will %s", actualAddress,