Merge "[Audiosharing] Update media devices section." into main
This commit is contained in:
@@ -29,6 +29,7 @@ import com.android.settings.flags.Flags;
|
||||
import com.android.settingslib.bluetooth.BluetoothUtils;
|
||||
import com.android.settingslib.bluetooth.CachedBluetoothDevice;
|
||||
import com.android.settingslib.bluetooth.CachedBluetoothDeviceManager;
|
||||
import com.android.settingslib.bluetooth.LocalBluetoothLeBroadcast;
|
||||
import com.android.settingslib.bluetooth.LocalBluetoothLeBroadcastAssistant;
|
||||
import com.android.settingslib.bluetooth.LocalBluetoothManager;
|
||||
import com.android.settingslib.utils.ThreadUtils;
|
||||
@@ -298,4 +299,20 @@ public class AudioSharingUtils {
|
||||
targetDevice.setActive();
|
||||
}
|
||||
}
|
||||
|
||||
/** Returns if the broadcast is on-going. */
|
||||
public static boolean isBroadcasting(LocalBluetoothManager manager) {
|
||||
if (manager == null) return false;
|
||||
LocalBluetoothLeBroadcast broadcast =
|
||||
manager.getProfileManager().getLeAudioBroadcastProfile();
|
||||
return broadcast != null && broadcast.isEnabled(null);
|
||||
}
|
||||
|
||||
/** Stops the latest broadcast. */
|
||||
public static void stopBroadcasting(LocalBluetoothManager manager) {
|
||||
if (manager == null) return;
|
||||
LocalBluetoothLeBroadcast broadcast =
|
||||
manager.getProfileManager().getLeAudioBroadcastProfile();
|
||||
broadcast.stopBroadcast(broadcast.getLatestBroadcastId());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user