Loading src/com/android/settings/media/MediaOutputIndicatorWorker.java +8 −0 Original line number Diff line number Diff line Loading @@ -167,12 +167,20 @@ public class MediaOutputIndicatorWorker extends SliceBackgroundWorker implements /** Check if this device supports LE Audio Broadcast feature */ public boolean isBroadcastSupported() { if (mLocalBluetoothManager == null) { Log.e(TAG, "isBroadcastSupported: Bluetooth is not supported on this device"); return false; } LocalBluetoothLeBroadcast broadcast = mLocalBluetoothManager.getProfileManager().getLeAudioBroadcastProfile(); return broadcast != null ? true : false; } public boolean isDeviceBroadcasting() { if (mLocalBluetoothManager == null) { Log.e(TAG, "isDeviceBroadcasting: Bluetooth is not supported on this device"); return false; } LocalBluetoothLeBroadcast broadcast = mLocalBluetoothManager.getProfileManager().getLeAudioBroadcastProfile(); if (broadcast == null) { Loading tests/robotests/src/com/android/settings/media/MediaOutputIndicatorWorkerTest.java +14 −0 Original line number Diff line number Diff line Loading @@ -313,4 +313,18 @@ public class MediaOutputIndicatorWorkerTest { assertThat(mMediaOutputIndicatorWorker.isBroadcastSupported()).isTrue(); } @Test public void isBroadcastSupported_noLocalMediaManager_returnFalse() { mMediaOutputIndicatorWorker.mLocalMediaManager = null; assertThat(mMediaOutputIndicatorWorker.isBroadcastSupported()).isFalse(); } @Test public void isDeviceBroadcasting_noLocalMediaManager_returnFalse() { mMediaOutputIndicatorWorker.mLocalMediaManager = null; assertThat(mMediaOutputIndicatorWorker.isDeviceBroadcasting()).isFalse(); } } Loading
src/com/android/settings/media/MediaOutputIndicatorWorker.java +8 −0 Original line number Diff line number Diff line Loading @@ -167,12 +167,20 @@ public class MediaOutputIndicatorWorker extends SliceBackgroundWorker implements /** Check if this device supports LE Audio Broadcast feature */ public boolean isBroadcastSupported() { if (mLocalBluetoothManager == null) { Log.e(TAG, "isBroadcastSupported: Bluetooth is not supported on this device"); return false; } LocalBluetoothLeBroadcast broadcast = mLocalBluetoothManager.getProfileManager().getLeAudioBroadcastProfile(); return broadcast != null ? true : false; } public boolean isDeviceBroadcasting() { if (mLocalBluetoothManager == null) { Log.e(TAG, "isDeviceBroadcasting: Bluetooth is not supported on this device"); return false; } LocalBluetoothLeBroadcast broadcast = mLocalBluetoothManager.getProfileManager().getLeAudioBroadcastProfile(); if (broadcast == null) { Loading
tests/robotests/src/com/android/settings/media/MediaOutputIndicatorWorkerTest.java +14 −0 Original line number Diff line number Diff line Loading @@ -313,4 +313,18 @@ public class MediaOutputIndicatorWorkerTest { assertThat(mMediaOutputIndicatorWorker.isBroadcastSupported()).isTrue(); } @Test public void isBroadcastSupported_noLocalMediaManager_returnFalse() { mMediaOutputIndicatorWorker.mLocalMediaManager = null; assertThat(mMediaOutputIndicatorWorker.isBroadcastSupported()).isFalse(); } @Test public void isDeviceBroadcasting_noLocalMediaManager_returnFalse() { mMediaOutputIndicatorWorker.mLocalMediaManager = null; assertThat(mMediaOutputIndicatorWorker.isDeviceBroadcasting()).isFalse(); } }