Change the switcher to switch LE audio mode with broadcast
Change the previous toggle design to list option for broadcast feature. The new toggle change is only applied as broadcast feature enabled whcih is behind a feature flag. Bug: 273153850 Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothLeAudioPreferenceControllerTest Change-Id: Ic2ea10d9d9529a2d413525c1b660f8fbac371502
This commit is contained in:
@@ -21,6 +21,7 @@ import android.bluetooth.BluetoothManager;
|
||||
import android.bluetooth.BluetoothStatusCodes;
|
||||
import android.content.Context;
|
||||
import android.os.SystemProperties;
|
||||
import android.sysprop.BluetoothProperties;
|
||||
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
import androidx.preference.Preference;
|
||||
@@ -64,6 +65,12 @@ public class BluetoothLeAudioPreferenceController
|
||||
return PREFERENCE_KEY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
return BluetoothProperties.isProfileBapUnicastClientEnabled().orElse(false)
|
||||
&& !BluetoothProperties.isProfileBapBroadcastSourceEnabled().orElse(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
BluetoothRebootDialog.show(mFragment);
|
||||
|
||||
Reference in New Issue
Block a user