[Audiosharing] Adopt fallback API when developer preview on

Test: atest
Flag: com.android.settingslib.flags.audio_sharing_developer_option
Bug: 381946931
Change-Id: Ia7d7164c320e5e15db203f5d1f7958f194f04286
This commit is contained in:
Yiyi Shen
2025-02-13 17:12:25 +08:00
parent ceaa16575a
commit 8af37b2438
2 changed files with 7 additions and 2 deletions

View File

@@ -340,7 +340,9 @@ public class AudioSharingCallAudioPreferenceController extends AudioSharingBaseP
if (lead != null) {
String addr = lead.getDevice().getAnonymizedAddress();
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
: mBtManager.getProfileManager().getLeAudioProfile();
if (leaProfile != null) {

View File

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