Loading android/app/src/com/android/bluetooth/btservice/AdapterService.java +16 −3 Original line number Diff line number Diff line Loading @@ -4336,9 +4336,22 @@ public class AdapterService extends Service { // If there are no preferences stored, return the defaults Bundle storedBundle = mDatabaseManager.getPreferredAudioProfiles(groupLead); if (storedBundle.isEmpty()) { //TODO(b/265077414): replace with default audio policy sysprop int outputOnlyDefault = BluetoothProfile.LE_AUDIO; int duplexDefault = BluetoothProfile.LE_AUDIO; // Gets the default output only audio profile or defaults to LE_AUDIO if not present int outputOnlyDefault = BluetoothProperties.getDefaultOutputOnlyAudioProfile().orElse( BluetoothProfile.LE_AUDIO); if (outputOnlyDefault != BluetoothProfile.A2DP && outputOnlyDefault != BluetoothProfile.LE_AUDIO) { outputOnlyDefault = BluetoothProfile.LE_AUDIO; } // Gets the default duplex audio profile or defaults to LE_AUDIO if not present int duplexDefault = BluetoothProperties.getDefaultDuplexAudioProfile().orElse( BluetoothProfile.LE_AUDIO); if (duplexDefault != BluetoothProfile.HEADSET && duplexDefault != BluetoothProfile.LE_AUDIO) { duplexDefault = BluetoothProfile.LE_AUDIO; } if (isOutputOnlyAudioSupported(groupLead)) { storedBundle.putInt(BluetoothAdapter.AUDIO_MODE_OUTPUT_ONLY, outputOnlyDefault); } Loading framework/java/android/bluetooth/BluetoothAdapter.java +3 −1 Original line number Diff line number Diff line Loading @@ -5079,7 +5079,9 @@ public final class BluetoothAdapter { * Gets the preferred profile for each audio mode for system routed audio. This API * returns a Bundle with mappings between each audio mode and its preferred audio profile. If no * values are set via {@link #setPreferredAudioProfiles(BluetoothDevice, Bundle)}, this API * returns the default system preferences set via a sysprop. * returns the default system preferences set via the sysprops * {@link BluetoothProperties#getDefaultOutputOnlyAudioProfile()} and * {@link BluetoothProperties#getDefaultDuplexAudioProfile()}. * <p> * An audio capable device must support at least one audio mode with a preferred audio profile. * If a device does not support an audio mode, the audio mode will be omitted from the keys of Loading Loading
android/app/src/com/android/bluetooth/btservice/AdapterService.java +16 −3 Original line number Diff line number Diff line Loading @@ -4336,9 +4336,22 @@ public class AdapterService extends Service { // If there are no preferences stored, return the defaults Bundle storedBundle = mDatabaseManager.getPreferredAudioProfiles(groupLead); if (storedBundle.isEmpty()) { //TODO(b/265077414): replace with default audio policy sysprop int outputOnlyDefault = BluetoothProfile.LE_AUDIO; int duplexDefault = BluetoothProfile.LE_AUDIO; // Gets the default output only audio profile or defaults to LE_AUDIO if not present int outputOnlyDefault = BluetoothProperties.getDefaultOutputOnlyAudioProfile().orElse( BluetoothProfile.LE_AUDIO); if (outputOnlyDefault != BluetoothProfile.A2DP && outputOnlyDefault != BluetoothProfile.LE_AUDIO) { outputOnlyDefault = BluetoothProfile.LE_AUDIO; } // Gets the default duplex audio profile or defaults to LE_AUDIO if not present int duplexDefault = BluetoothProperties.getDefaultDuplexAudioProfile().orElse( BluetoothProfile.LE_AUDIO); if (duplexDefault != BluetoothProfile.HEADSET && duplexDefault != BluetoothProfile.LE_AUDIO) { duplexDefault = BluetoothProfile.LE_AUDIO; } if (isOutputOnlyAudioSupported(groupLead)) { storedBundle.putInt(BluetoothAdapter.AUDIO_MODE_OUTPUT_ONLY, outputOnlyDefault); } Loading
framework/java/android/bluetooth/BluetoothAdapter.java +3 −1 Original line number Diff line number Diff line Loading @@ -5079,7 +5079,9 @@ public final class BluetoothAdapter { * Gets the preferred profile for each audio mode for system routed audio. This API * returns a Bundle with mappings between each audio mode and its preferred audio profile. If no * values are set via {@link #setPreferredAudioProfiles(BluetoothDevice, Bundle)}, this API * returns the default system preferences set via a sysprop. * returns the default system preferences set via the sysprops * {@link BluetoothProperties#getDefaultOutputOnlyAudioProfile()} and * {@link BluetoothProperties#getDefaultDuplexAudioProfile()}. * <p> * An audio capable device must support at least one audio mode with a preferred audio profile. * If a device does not support an audio mode, the audio mode will be omitted from the keys of Loading