Loading core/java/android/bluetooth/BluetoothUuid.java +1 −1 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ public final class BluetoothUuid { } public static boolean isHandsfree(UUID uuid) { return uuid.equals(Handsfree) || uuid.equals(HandsfreeAudioGateway); return uuid.equals(Handsfree); } public static boolean isHeadset(UUID uuid) { Loading core/java/android/server/BluetoothA2dpService.java +14 −1 Original line number Diff line number Diff line Loading @@ -104,7 +104,8 @@ public class BluetoothA2dpService extends IBluetoothA2dp.Stub { break; } } else if (action.equals(BluetoothIntent.REMOTE_DEVICE_CONNECTED_ACTION)) { if (getSinkPriority(address) > BluetoothA2dp.PRIORITY_OFF) { if (getSinkPriority(address) > BluetoothA2dp.PRIORITY_OFF && isSinkDevice(address)) { // This device is a preferred sink. Make an A2DP connection // after a delay. We delay to avoid connection collisions, // and to give other profiles such as HFP a chance to Loading Loading @@ -185,6 +186,18 @@ public class BluetoothA2dpService extends IBluetoothA2dp.Stub { return -1; } private boolean isSinkDevice(String address) { String uuids[] = mBluetoothService.getRemoteUuids(address); UUID uuid; for (String deviceUuid: uuids) { uuid = UUID.fromString(deviceUuid); if (BluetoothUuid.isAudioSink(uuid)) { return true; } } return false; } private synchronized boolean addAudioSink (String address) { String path = mBluetoothService.getObjectPathFromAddress(address); String propValues[] = (String []) getSinkPropertiesNative(path); Loading core/java/android/server/BluetoothEventLoop.java +1 −3 Original line number Diff line number Diff line Loading @@ -371,9 +371,7 @@ class BluetoothEventLoop { boolean authorized = false; UUID uuid = UUID.fromString(deviceUuid); if (mBluetoothService.isEnabled() && (BluetoothUuid.isAudioSink(uuid) || BluetoothUuid.isAudioSource(uuid) || BluetoothUuid.isAdvAudioDist(uuid))) { if (mBluetoothService.isEnabled() && BluetoothUuid.isAudioSink(uuid)) { BluetoothA2dp a2dp = new BluetoothA2dp(mContext); authorized = a2dp.getSinkPriority(address) > BluetoothA2dp.PRIORITY_OFF; if (authorized) { Loading Loading
core/java/android/bluetooth/BluetoothUuid.java +1 −1 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ public final class BluetoothUuid { } public static boolean isHandsfree(UUID uuid) { return uuid.equals(Handsfree) || uuid.equals(HandsfreeAudioGateway); return uuid.equals(Handsfree); } public static boolean isHeadset(UUID uuid) { Loading
core/java/android/server/BluetoothA2dpService.java +14 −1 Original line number Diff line number Diff line Loading @@ -104,7 +104,8 @@ public class BluetoothA2dpService extends IBluetoothA2dp.Stub { break; } } else if (action.equals(BluetoothIntent.REMOTE_DEVICE_CONNECTED_ACTION)) { if (getSinkPriority(address) > BluetoothA2dp.PRIORITY_OFF) { if (getSinkPriority(address) > BluetoothA2dp.PRIORITY_OFF && isSinkDevice(address)) { // This device is a preferred sink. Make an A2DP connection // after a delay. We delay to avoid connection collisions, // and to give other profiles such as HFP a chance to Loading Loading @@ -185,6 +186,18 @@ public class BluetoothA2dpService extends IBluetoothA2dp.Stub { return -1; } private boolean isSinkDevice(String address) { String uuids[] = mBluetoothService.getRemoteUuids(address); UUID uuid; for (String deviceUuid: uuids) { uuid = UUID.fromString(deviceUuid); if (BluetoothUuid.isAudioSink(uuid)) { return true; } } return false; } private synchronized boolean addAudioSink (String address) { String path = mBluetoothService.getObjectPathFromAddress(address); String propValues[] = (String []) getSinkPropertiesNative(path); Loading
core/java/android/server/BluetoothEventLoop.java +1 −3 Original line number Diff line number Diff line Loading @@ -371,9 +371,7 @@ class BluetoothEventLoop { boolean authorized = false; UUID uuid = UUID.fromString(deviceUuid); if (mBluetoothService.isEnabled() && (BluetoothUuid.isAudioSink(uuid) || BluetoothUuid.isAudioSource(uuid) || BluetoothUuid.isAdvAudioDist(uuid))) { if (mBluetoothService.isEnabled() && BluetoothUuid.isAudioSink(uuid)) { BluetoothA2dp a2dp = new BluetoothA2dp(mContext); authorized = a2dp.getSinkPriority(address) > BluetoothA2dp.PRIORITY_OFF; if (authorized) { Loading