[Audiosharing] Use setBroadcastToUnicastFallbackGroup to set primary

Flag: com.android.settingslib.flags.adopt_primary_group_management_api
Test: atest
Bug: 381946931
Change-Id: Ib06dd2e202b07b9cdb25b1a671ee4d57246415ba
This commit is contained in:
Yiyi Shen
2025-01-15 15:25:32 +08:00
parent e87733be63
commit 27e4fcc6c6
7 changed files with 88 additions and 29 deletions

View File

@@ -389,7 +389,8 @@ public class AudioSharingDevicePreferenceController extends BasePreferenceContro
Log.d(TAG, "onDeviceClick, set active in call mode");
CachedBluetoothDevice cachedDevice =
((BluetoothDevicePreference) preference).getBluetoothDevice();
AudioSharingUtils.setPrimary(mContext, cachedDevice);
cachedDevice.setActive();
AudioSharingUtils.setUserPreferredPrimary(mContext, cachedDevice);
}
mMetricsFeatureProvider.action(mContext, SettingsEnums.ACTION_AUDIO_SHARING_DEVICE_CLICK,
isCallMode);