Loading services/core/java/com/android/server/audio/AudioDeviceBroker.java +1 −2 Original line number Diff line number Diff line Loading @@ -569,7 +569,6 @@ import com.android.internal.annotations.GuardedBy; return mBrokerHandler.hasMessages(MSG_IL_BTA2DP_DOCK_TIMEOUT); } //### // must be called synchronized on mConnectedDevices /*package*/ boolean hasScheduledA2dpSinkConnectionState(BluetoothDevice btDevice) { return mBrokerHandler.hasMessages(MSG_IL_SET_A2DP_SINK_CONNECTION_STATE, Loading services/core/java/com/android/server/audio/AudioDeviceInventory.java +10 −3 Original line number Diff line number Diff line Loading @@ -146,6 +146,7 @@ public final class AudioDeviceInventory { } } @GuardedBy("AudioDeviceBroker.mDeviceStateLock") /*package*/ void onSetA2dpSinkConnectionState(@NonNull BtHelper.BluetoothA2dpDeviceInfo btInfo, @AudioService.BtProfileConnectionState int state) { final BluetoothDevice btDevice = btInfo.getBtDevice(); Loading Loading @@ -259,6 +260,7 @@ public final class AudioDeviceInventory { } } @GuardedBy("AudioDeviceBroker.mDeviceStateLock") /*package*/ void onBluetoothA2dpActiveDeviceChange( @NonNull BtHelper.BluetoothA2dpDeviceInfo btInfo, int event) { final BluetoothDevice btDevice = btInfo.getBtDevice(); Loading Loading @@ -532,6 +534,7 @@ public final class AudioDeviceInventory { return mCurAudioRoutes; } @GuardedBy("AudioDeviceBroker.mDeviceStateLock") /*package*/ void setBluetoothA2dpDeviceConnectionState( @NonNull BluetoothDevice device, @AudioService.BtProfileConnectionState int state, int profile, boolean suppressNoisyIntent, int musicDevice, int a2dpVolume) { Loading Loading @@ -559,9 +562,13 @@ public final class AudioDeviceInventory { final BtHelper.BluetoothA2dpDeviceInfo a2dpDeviceInfo = new BtHelper.BluetoothA2dpDeviceInfo(device, a2dpVolume, a2dpCodec); if (profile == BluetoothProfile.A2DP) { if (delay == 0) { onSetA2dpSinkConnectionState(a2dpDeviceInfo, state); } else { mDeviceBroker.postA2dpSinkConnection(state, a2dpDeviceInfo, delay); } } else { //profile == BluetoothProfile.A2DP_SINK mDeviceBroker.postA2dpSourceConnection(state, a2dpDeviceInfo, Loading services/core/java/com/android/server/audio/AudioService.java +2 −0 Original line number Diff line number Diff line Loading @@ -5508,6 +5508,8 @@ public class AudioService extends IAudioService.Stub public void avrcpSupportsAbsoluteVolume(String address, boolean support) { // address is not used for now, but may be used when multiple a2dp devices are supported sVolumeLogger.log(new AudioEventLogger.StringEvent("avrcpSupportsAbsoluteVolume addr=" + address + " support=" + support)); mDeviceBroker.setAvrcpAbsoluteVolumeSupported(support); sendMsg(mAudioHandler, MSG_SET_DEVICE_VOLUME, SENDMSG_QUEUE, AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, 0, Loading services/core/java/com/android/server/audio/BtHelper.java +5 −1 Original line number Diff line number Diff line Loading @@ -200,16 +200,20 @@ public class BtHelper { /*package*/ synchronized void setAvrcpAbsoluteVolumeSupported(boolean supported) { mAvrcpAbsVolSupported = supported; Log.i(TAG, "setAvrcpAbsoluteVolumeSupported supported=" + supported); } /*package*/ synchronized void setAvrcpAbsoluteVolumeIndex(int index) { if (mA2dp == null) { if (AudioService.DEBUG_VOL) { Log.d(TAG, "setAvrcpAbsoluteVolumeIndex: bailing due to null mA2dp"); AudioService.sVolumeLogger.log(new AudioEventLogger.StringEvent( "setAvrcpAbsoluteVolumeIndex: bailing due to null mA2dp").printLog(TAG)); return; } } if (!mAvrcpAbsVolSupported) { AudioService.sVolumeLogger.log(new AudioEventLogger.StringEvent( "setAvrcpAbsoluteVolumeIndex: abs vol not supported ").printLog(TAG)); return; } if (AudioService.DEBUG_VOL) { Loading Loading
services/core/java/com/android/server/audio/AudioDeviceBroker.java +1 −2 Original line number Diff line number Diff line Loading @@ -569,7 +569,6 @@ import com.android.internal.annotations.GuardedBy; return mBrokerHandler.hasMessages(MSG_IL_BTA2DP_DOCK_TIMEOUT); } //### // must be called synchronized on mConnectedDevices /*package*/ boolean hasScheduledA2dpSinkConnectionState(BluetoothDevice btDevice) { return mBrokerHandler.hasMessages(MSG_IL_SET_A2DP_SINK_CONNECTION_STATE, Loading
services/core/java/com/android/server/audio/AudioDeviceInventory.java +10 −3 Original line number Diff line number Diff line Loading @@ -146,6 +146,7 @@ public final class AudioDeviceInventory { } } @GuardedBy("AudioDeviceBroker.mDeviceStateLock") /*package*/ void onSetA2dpSinkConnectionState(@NonNull BtHelper.BluetoothA2dpDeviceInfo btInfo, @AudioService.BtProfileConnectionState int state) { final BluetoothDevice btDevice = btInfo.getBtDevice(); Loading Loading @@ -259,6 +260,7 @@ public final class AudioDeviceInventory { } } @GuardedBy("AudioDeviceBroker.mDeviceStateLock") /*package*/ void onBluetoothA2dpActiveDeviceChange( @NonNull BtHelper.BluetoothA2dpDeviceInfo btInfo, int event) { final BluetoothDevice btDevice = btInfo.getBtDevice(); Loading Loading @@ -532,6 +534,7 @@ public final class AudioDeviceInventory { return mCurAudioRoutes; } @GuardedBy("AudioDeviceBroker.mDeviceStateLock") /*package*/ void setBluetoothA2dpDeviceConnectionState( @NonNull BluetoothDevice device, @AudioService.BtProfileConnectionState int state, int profile, boolean suppressNoisyIntent, int musicDevice, int a2dpVolume) { Loading Loading @@ -559,9 +562,13 @@ public final class AudioDeviceInventory { final BtHelper.BluetoothA2dpDeviceInfo a2dpDeviceInfo = new BtHelper.BluetoothA2dpDeviceInfo(device, a2dpVolume, a2dpCodec); if (profile == BluetoothProfile.A2DP) { if (delay == 0) { onSetA2dpSinkConnectionState(a2dpDeviceInfo, state); } else { mDeviceBroker.postA2dpSinkConnection(state, a2dpDeviceInfo, delay); } } else { //profile == BluetoothProfile.A2DP_SINK mDeviceBroker.postA2dpSourceConnection(state, a2dpDeviceInfo, Loading
services/core/java/com/android/server/audio/AudioService.java +2 −0 Original line number Diff line number Diff line Loading @@ -5508,6 +5508,8 @@ public class AudioService extends IAudioService.Stub public void avrcpSupportsAbsoluteVolume(String address, boolean support) { // address is not used for now, but may be used when multiple a2dp devices are supported sVolumeLogger.log(new AudioEventLogger.StringEvent("avrcpSupportsAbsoluteVolume addr=" + address + " support=" + support)); mDeviceBroker.setAvrcpAbsoluteVolumeSupported(support); sendMsg(mAudioHandler, MSG_SET_DEVICE_VOLUME, SENDMSG_QUEUE, AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, 0, Loading
services/core/java/com/android/server/audio/BtHelper.java +5 −1 Original line number Diff line number Diff line Loading @@ -200,16 +200,20 @@ public class BtHelper { /*package*/ synchronized void setAvrcpAbsoluteVolumeSupported(boolean supported) { mAvrcpAbsVolSupported = supported; Log.i(TAG, "setAvrcpAbsoluteVolumeSupported supported=" + supported); } /*package*/ synchronized void setAvrcpAbsoluteVolumeIndex(int index) { if (mA2dp == null) { if (AudioService.DEBUG_VOL) { Log.d(TAG, "setAvrcpAbsoluteVolumeIndex: bailing due to null mA2dp"); AudioService.sVolumeLogger.log(new AudioEventLogger.StringEvent( "setAvrcpAbsoluteVolumeIndex: bailing due to null mA2dp").printLog(TAG)); return; } } if (!mAvrcpAbsVolSupported) { AudioService.sVolumeLogger.log(new AudioEventLogger.StringEvent( "setAvrcpAbsoluteVolumeIndex: abs vol not supported ").printLog(TAG)); return; } if (AudioService.DEBUG_VOL) { Loading