Loading services/core/java/com/android/server/audio/AudioDeviceInventory.java +4 −5 Original line number Diff line number Diff line Loading @@ -207,7 +207,7 @@ public final class AudioDeviceInventory { mDeviceBroker.setDeviceVolume( streamState, AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP); } makeA2dpDeviceAvailable(address, btDevice.getName(), makeA2dpDeviceAvailable(address, BtHelper.getName(btDevice), "onSetA2dpSinkConnectionState", a2dpCodec); } } Loading Loading @@ -257,7 +257,7 @@ public final class AudioDeviceInventory { if (isConnected && state != BluetoothProfile.STATE_CONNECTED) { makeHearingAidDeviceUnavailable(address); } else if (!isConnected && state == BluetoothProfile.STATE_CONNECTED) { makeHearingAidDeviceAvailable(address, btDevice.getName(), makeHearingAidDeviceAvailable(address, BtHelper.getName(btDevice), "onSetHearingAidConnectionState"); } } Loading Loading @@ -318,7 +318,7 @@ public final class AudioDeviceInventory { } } if (AudioSystem.handleDeviceConfigChange(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, address, btDevice.getName(), a2dpCodec) != AudioSystem.AUDIO_STATUS_OK) { BtHelper.getName(btDevice), a2dpCodec) != AudioSystem.AUDIO_STATUS_OK) { int musicDevice = mDeviceBroker.getDeviceForStream(AudioSystem.STREAM_MUSIC); // force A2DP device disconnection in case of error so that AudioService state is // consistent with audio policy manager state Loading Loading @@ -603,10 +603,9 @@ public final class AudioDeviceInventory { } // A2DP device exists, handle active device change final String existingDevicekey = mConnectedDevices.keyAt(i); final String deviceName = device.getName(); mConnectedDevices.remove(existingDevicekey); mConnectedDevices.put(deviceKey, new DeviceInfo( AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, deviceName, AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, BtHelper.getName(device), address, a2dpCodec)); mDeviceBroker.postA2dpActiveDeviceChange( new BtHelper.BluetoothA2dpDeviceInfo( Loading services/core/java/com/android/server/audio/BtHelper.java +9 −1 Original line number Diff line number Diff line Loading @@ -152,6 +152,14 @@ public class BtHelper { } } /*package*/ @NonNull static String getName(@NonNull BluetoothDevice device) { final String deviceName = device.getName(); if (deviceName == null) { return ""; } return deviceName; } //---------------------------------------------------------------------- // Interface for AudioDeviceBroker Loading Loading @@ -515,7 +523,7 @@ public class BtHelper { if (!BluetoothAdapter.checkBluetoothAddress(address)) { address = ""; } String btDeviceName = btDevice.getName(); String btDeviceName = getName(btDevice); boolean result = false; if (isActive) { result |= mDeviceBroker.handleDeviceConnection( Loading Loading
services/core/java/com/android/server/audio/AudioDeviceInventory.java +4 −5 Original line number Diff line number Diff line Loading @@ -207,7 +207,7 @@ public final class AudioDeviceInventory { mDeviceBroker.setDeviceVolume( streamState, AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP); } makeA2dpDeviceAvailable(address, btDevice.getName(), makeA2dpDeviceAvailable(address, BtHelper.getName(btDevice), "onSetA2dpSinkConnectionState", a2dpCodec); } } Loading Loading @@ -257,7 +257,7 @@ public final class AudioDeviceInventory { if (isConnected && state != BluetoothProfile.STATE_CONNECTED) { makeHearingAidDeviceUnavailable(address); } else if (!isConnected && state == BluetoothProfile.STATE_CONNECTED) { makeHearingAidDeviceAvailable(address, btDevice.getName(), makeHearingAidDeviceAvailable(address, BtHelper.getName(btDevice), "onSetHearingAidConnectionState"); } } Loading Loading @@ -318,7 +318,7 @@ public final class AudioDeviceInventory { } } if (AudioSystem.handleDeviceConfigChange(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, address, btDevice.getName(), a2dpCodec) != AudioSystem.AUDIO_STATUS_OK) { BtHelper.getName(btDevice), a2dpCodec) != AudioSystem.AUDIO_STATUS_OK) { int musicDevice = mDeviceBroker.getDeviceForStream(AudioSystem.STREAM_MUSIC); // force A2DP device disconnection in case of error so that AudioService state is // consistent with audio policy manager state Loading Loading @@ -603,10 +603,9 @@ public final class AudioDeviceInventory { } // A2DP device exists, handle active device change final String existingDevicekey = mConnectedDevices.keyAt(i); final String deviceName = device.getName(); mConnectedDevices.remove(existingDevicekey); mConnectedDevices.put(deviceKey, new DeviceInfo( AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, deviceName, AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, BtHelper.getName(device), address, a2dpCodec)); mDeviceBroker.postA2dpActiveDeviceChange( new BtHelper.BluetoothA2dpDeviceInfo( Loading
services/core/java/com/android/server/audio/BtHelper.java +9 −1 Original line number Diff line number Diff line Loading @@ -152,6 +152,14 @@ public class BtHelper { } } /*package*/ @NonNull static String getName(@NonNull BluetoothDevice device) { final String deviceName = device.getName(); if (deviceName == null) { return ""; } return deviceName; } //---------------------------------------------------------------------- // Interface for AudioDeviceBroker Loading Loading @@ -515,7 +523,7 @@ public class BtHelper { if (!BluetoothAdapter.checkBluetoothAddress(address)) { address = ""; } String btDeviceName = btDevice.getName(); String btDeviceName = getName(btDevice); boolean result = false; if (isActive) { result |= mDeviceBroker.handleDeviceConnection( Loading