diff options
2 files changed, 13 insertions, 0 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/media/BluetoothMediaManager.java b/packages/SettingsLib/src/com/android/settingslib/media/BluetoothMediaManager.java index 151aa8d0cf6f..008943c99033 100644 --- a/packages/SettingsLib/src/com/android/settingslib/media/BluetoothMediaManager.java +++ b/packages/SettingsLib/src/com/android/settingslib/media/BluetoothMediaManager.java @@ -198,6 +198,11 @@ public class BluetoothMediaManager extends MediaManager implements BluetoothCall } @Override + public void onAudioModeChanged() { + dispatchDataChanged(); + } + + @Override public void onDeviceAdded(CachedBluetoothDevice cachedDevice) { if (isCachedDeviceConnected(cachedDevice)) { addMediaDevice(cachedDevice); diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/BluetoothMediaManagerTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/BluetoothMediaManagerTest.java index 70b04ab40c34..030bab6a2034 100644 --- a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/BluetoothMediaManagerTest.java +++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/BluetoothMediaManagerTest.java @@ -455,4 +455,12 @@ public class BluetoothMediaManagerTest { verify(mCallback).onConnectedDeviceChanged(PhoneMediaDevice.ID); } + + @Test + public void onAudioModeChanged_shouldCallOnDeviceAttributesChanged() { + mMediaManager.registerCallback(mCallback); + mMediaManager.onAudioModeChanged(); + + verify(mCallback).onDeviceAttributesChanged(); + } } |