Loading core/java/android/bluetooth/BluetoothDeviceProfileState.java +1 −1 Original line number Diff line number Diff line Loading @@ -127,7 +127,7 @@ public final class BluetoothDeviceProfileState extends StateMachine { public void onReceive(Context context, Intent intent) { String action = intent.getAction(); BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); if (!device.equals(mDevice)) return; if (device == null || !device.equals(mDevice)) return; if (action.equals(BluetoothA2dp.ACTION_CONNECTION_STATE_CHANGED)) { int newState = intent.getIntExtra(BluetoothProfile.EXTRA_STATE, 0); Loading core/java/android/bluetooth/BluetoothProfileState.java +3 −1 Original line number Diff line number Diff line Loading @@ -59,7 +59,9 @@ public class BluetoothProfileState extends StateMachine { public void onReceive(Context context, Intent intent) { String action = intent.getAction(); BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); if (device == null) { return; } if (action.equals(BluetoothHeadset.ACTION_CONNECTION_STATE_CHANGED)) { int newState = intent.getIntExtra(BluetoothProfile.EXTRA_STATE, 0); if (mProfile == HFP && (newState == BluetoothProfile.STATE_CONNECTED || Loading media/java/android/media/AudioService.java +26 −14 Original line number Diff line number Diff line Loading @@ -2295,7 +2295,13 @@ public class AudioService extends IAudioService.Stub { int state = intent.getIntExtra(BluetoothProfile.EXTRA_STATE, BluetoothProfile.STATE_DISCONNECTED); BluetoothDevice btDevice = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); if (btDevice == null) { return; } String address = btDevice.getAddress(); if (!BluetoothAdapter.checkBluetoothAddress(address)) { address = ""; } boolean isConnected = (mConnectedDevices.containsKey(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP) && mConnectedDevices.get(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP).equals(address)); Loading Loading @@ -2331,9 +2337,13 @@ public class AudioService extends IAudioService.Stub { int state = intent.getIntExtra(BluetoothProfile.EXTRA_STATE, BluetoothProfile.STATE_DISCONNECTED); int device = AudioSystem.DEVICE_OUT_BLUETOOTH_SCO; BluetoothDevice btDevice = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); String address = null; if (btDevice != null) { BluetoothDevice btDevice = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); if (btDevice == null) { return; } address = btDevice.getAddress(); BluetoothClass btClass = btDevice.getBluetoothClass(); if (btClass != null) { Loading @@ -2347,8 +2357,10 @@ public class AudioService extends IAudioService.Stub { break; } } } if (!BluetoothAdapter.checkBluetoothAddress(address)) { address = ""; } boolean isConnected = (mConnectedDevices.containsKey(device) && mConnectedDevices.get(device).equals(address)); Loading media/libmedia/AudioSystem.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -511,9 +511,15 @@ status_t AudioSystem::setDeviceConnectionState(audio_devices_t device, const char *device_address) { const sp<IAudioPolicyService>& aps = AudioSystem::get_audio_policy_service(); const char *address = ""; if (aps == 0) return PERMISSION_DENIED; return aps->setDeviceConnectionState(device, state, device_address); if (device_address != NULL) { address = device_address; } return aps->setDeviceConnectionState(device, state, address); } audio_policy_dev_state_t AudioSystem::getDeviceConnectionState(audio_devices_t device, Loading Loading
core/java/android/bluetooth/BluetoothDeviceProfileState.java +1 −1 Original line number Diff line number Diff line Loading @@ -127,7 +127,7 @@ public final class BluetoothDeviceProfileState extends StateMachine { public void onReceive(Context context, Intent intent) { String action = intent.getAction(); BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); if (!device.equals(mDevice)) return; if (device == null || !device.equals(mDevice)) return; if (action.equals(BluetoothA2dp.ACTION_CONNECTION_STATE_CHANGED)) { int newState = intent.getIntExtra(BluetoothProfile.EXTRA_STATE, 0); Loading
core/java/android/bluetooth/BluetoothProfileState.java +3 −1 Original line number Diff line number Diff line Loading @@ -59,7 +59,9 @@ public class BluetoothProfileState extends StateMachine { public void onReceive(Context context, Intent intent) { String action = intent.getAction(); BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); if (device == null) { return; } if (action.equals(BluetoothHeadset.ACTION_CONNECTION_STATE_CHANGED)) { int newState = intent.getIntExtra(BluetoothProfile.EXTRA_STATE, 0); if (mProfile == HFP && (newState == BluetoothProfile.STATE_CONNECTED || Loading
media/java/android/media/AudioService.java +26 −14 Original line number Diff line number Diff line Loading @@ -2295,7 +2295,13 @@ public class AudioService extends IAudioService.Stub { int state = intent.getIntExtra(BluetoothProfile.EXTRA_STATE, BluetoothProfile.STATE_DISCONNECTED); BluetoothDevice btDevice = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); if (btDevice == null) { return; } String address = btDevice.getAddress(); if (!BluetoothAdapter.checkBluetoothAddress(address)) { address = ""; } boolean isConnected = (mConnectedDevices.containsKey(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP) && mConnectedDevices.get(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP).equals(address)); Loading Loading @@ -2331,9 +2337,13 @@ public class AudioService extends IAudioService.Stub { int state = intent.getIntExtra(BluetoothProfile.EXTRA_STATE, BluetoothProfile.STATE_DISCONNECTED); int device = AudioSystem.DEVICE_OUT_BLUETOOTH_SCO; BluetoothDevice btDevice = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); String address = null; if (btDevice != null) { BluetoothDevice btDevice = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); if (btDevice == null) { return; } address = btDevice.getAddress(); BluetoothClass btClass = btDevice.getBluetoothClass(); if (btClass != null) { Loading @@ -2347,8 +2357,10 @@ public class AudioService extends IAudioService.Stub { break; } } } if (!BluetoothAdapter.checkBluetoothAddress(address)) { address = ""; } boolean isConnected = (mConnectedDevices.containsKey(device) && mConnectedDevices.get(device).equals(address)); Loading
media/libmedia/AudioSystem.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -511,9 +511,15 @@ status_t AudioSystem::setDeviceConnectionState(audio_devices_t device, const char *device_address) { const sp<IAudioPolicyService>& aps = AudioSystem::get_audio_policy_service(); const char *address = ""; if (aps == 0) return PERMISSION_DENIED; return aps->setDeviceConnectionState(device, state, device_address); if (device_address != NULL) { address = device_address; } return aps->setDeviceConnectionState(device, state, address); } audio_policy_dev_state_t AudioSystem::getDeviceConnectionState(audio_devices_t device, Loading