Merge "Fix the NullPointerException" into udc-qpr-dev am: acd7bbefd1
am: 6058a62ad7
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/24523908 Change-Id: Ia3126898342da4f39f9431a423f25a6270ae3107 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -171,12 +171,20 @@ public class MediaOutputIndicatorWorker extends SliceBackgroundWorker implements
|
|||||||
|
|
||||||
/** Check if this device supports LE Audio Broadcast feature */
|
/** Check if this device supports LE Audio Broadcast feature */
|
||||||
public boolean isBroadcastSupported() {
|
public boolean isBroadcastSupported() {
|
||||||
|
if (mLocalBluetoothManager == null) {
|
||||||
|
Log.e(TAG, "isBroadcastSupported: Bluetooth is not supported on this device");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
LocalBluetoothLeBroadcast broadcast =
|
LocalBluetoothLeBroadcast broadcast =
|
||||||
mLocalBluetoothManager.getProfileManager().getLeAudioBroadcastProfile();
|
mLocalBluetoothManager.getProfileManager().getLeAudioBroadcastProfile();
|
||||||
return broadcast != null ? true : false;
|
return broadcast != null ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isDeviceBroadcasting() {
|
public boolean isDeviceBroadcasting() {
|
||||||
|
if (mLocalBluetoothManager == null) {
|
||||||
|
Log.e(TAG, "isDeviceBroadcasting: Bluetooth is not supported on this device");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
LocalBluetoothLeBroadcast broadcast =
|
LocalBluetoothLeBroadcast broadcast =
|
||||||
mLocalBluetoothManager.getProfileManager().getLeAudioBroadcastProfile();
|
mLocalBluetoothManager.getProfileManager().getLeAudioBroadcastProfile();
|
||||||
if (broadcast == null) {
|
if (broadcast == null) {
|
||||||
|
@@ -313,4 +313,18 @@ public class MediaOutputIndicatorWorkerTest {
|
|||||||
|
|
||||||
assertThat(mMediaOutputIndicatorWorker.isBroadcastSupported()).isTrue();
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user