Merge "[Audiosharing] Adopt fallback API when developer preview on" into main

This commit is contained in:
Yiyi Shen
2025-02-20 23:01:25 -08:00
committed by Android (Google) Code Review
2 changed files with 7 additions and 2 deletions

View File

@@ -339,7 +339,9 @@ public class AudioSharingCallAudioPreferenceController extends AudioSharingBaseP
if (lead != null) { if (lead != null) {
String addr = lead.getDevice().getAnonymizedAddress(); String addr = lead.getDevice().getAnonymizedAddress();
Log.d(TAG, "Set call audio device: " + addr); Log.d(TAG, "Set call audio device: " + addr);
if (Flags.adoptPrimaryGroupManagementApi() && !mIsAudioModeOngoingCall.get()) { if ((Flags.adoptPrimaryGroupManagementApi() || (Flags.audioSharingDeveloperOption()
&& BluetoothUtils.getAudioSharingPreviewValue(mContentResolver)))
&& !mIsAudioModeOngoingCall.get()) {
LeAudioProfile leaProfile = mBtManager == null ? null LeAudioProfile leaProfile = mBtManager == null ? null
: mBtManager.getProfileManager().getLeAudioProfile(); : mBtManager.getProfileManager().getLeAudioProfile();
if (leaProfile != null) { if (leaProfile != null) {

View File

@@ -227,7 +227,10 @@ public class AudioSharingDialogHandler {
mLocalBtManager, groupedDevices, /* filterByInSharing= */ true); mLocalBtManager, groupedDevices, /* filterByInSharing= */ true);
AudioSharingStopDialogFragment.DialogEventListener listener = AudioSharingStopDialogFragment.DialogEventListener listener =
() -> { () -> {
if (Flags.adoptPrimaryGroupManagementApi() && mLocalBtManager != null) { if (mLocalBtManager != null && (Flags.adoptPrimaryGroupManagementApi() || (
mContext != null && Flags.audioSharingDeveloperOption()
&& BluetoothUtils.getAudioSharingPreviewValue(
mContext.getContentResolver())))) {
LeAudioProfile profile = LeAudioProfile profile =
mLocalBtManager.getProfileManager().getLeAudioProfile(); mLocalBtManager.getProfileManager().getLeAudioProfile();
if (profile != null) { if (profile != null) {