Loading media/java/android/media/AudioService.java +13 −2 Original line number Diff line number Diff line Loading @@ -2384,14 +2384,25 @@ public class AudioService extends IAudioService.Stub { } } public void onServiceDisconnected(int profile) { Log.d(TAG, "onServiceDisconnected: Bluetooth profile: " + profile); switch(profile) { case BluetoothProfile.A2DP: synchronized (mA2dpAvrcpLock) { mA2dp = null; synchronized (mConnectedDevices) { if (mConnectedDevices.containsKey(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP)) { makeA2dpDeviceUnavailableNow( mConnectedDevices.get(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP)); Log.d(TAG, "A2dp service disconnects, pause music player"); BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter(); BluetoothDevice btDevice = adapter.getRemoteDevice (mConnectedDevices.get(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP)); int delay = checkSendBecomingNoisyIntent( AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, 0); queueMsgUnderWakeLock(mAudioHandler, MSG_SET_A2DP_CONNECTION_STATE, BluetoothA2dp.STATE_DISCONNECTED, 0, btDevice, delay); } } } Loading Loading
media/java/android/media/AudioService.java +13 −2 Original line number Diff line number Diff line Loading @@ -2384,14 +2384,25 @@ public class AudioService extends IAudioService.Stub { } } public void onServiceDisconnected(int profile) { Log.d(TAG, "onServiceDisconnected: Bluetooth profile: " + profile); switch(profile) { case BluetoothProfile.A2DP: synchronized (mA2dpAvrcpLock) { mA2dp = null; synchronized (mConnectedDevices) { if (mConnectedDevices.containsKey(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP)) { makeA2dpDeviceUnavailableNow( mConnectedDevices.get(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP)); Log.d(TAG, "A2dp service disconnects, pause music player"); BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter(); BluetoothDevice btDevice = adapter.getRemoteDevice (mConnectedDevices.get(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP)); int delay = checkSendBecomingNoisyIntent( AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, 0); queueMsgUnderWakeLock(mAudioHandler, MSG_SET_A2DP_CONNECTION_STATE, BluetoothA2dp.STATE_DISCONNECTED, 0, btDevice, delay); } } } Loading