Add LE audio hardware offload development option
Bug: 197296692 Bug: 215492586 Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothLeAudioHwOffloadPreferenceControllerTest Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothA2dpHwOffloadPreferenceControllerTest Change-Id: If1203c50d1d94ac9ed377293b5cb389b7b6f54a1
This commit is contained in:
@@ -80,7 +80,7 @@ import java.util.List;
|
||||
public class DevelopmentSettingsDashboardFragment extends RestrictedDashboardFragment
|
||||
implements OnMainSwitchChangeListener, OemUnlockDialogHost, AdbDialogHost,
|
||||
AdbClearKeysDialogHost, LogPersistDialogHost,
|
||||
BluetoothA2dpHwOffloadRebootDialog.OnA2dpHwDialogConfirmedListener,
|
||||
BluetoothHwOffloadRebootDialog.OnHwOffloadDialogListener,
|
||||
AbstractBluetoothPreferenceController.Callback {
|
||||
|
||||
private static final String TAG = "DevSettingsDashboard";
|
||||
@@ -293,12 +293,16 @@ public class DevelopmentSettingsDashboardFragment extends RestrictedDashboardFra
|
||||
if (isChecked) {
|
||||
EnableDevelopmentSettingWarningDialog.show(this /* host */);
|
||||
} else {
|
||||
final BluetoothA2dpHwOffloadPreferenceController controller =
|
||||
final BluetoothA2dpHwOffloadPreferenceController a2dpController =
|
||||
getDevelopmentOptionsController(
|
||||
BluetoothA2dpHwOffloadPreferenceController.class);
|
||||
// If A2DP hardware offload isn't default value, we must reboot after disable
|
||||
final BluetoothLeAudioHwOffloadPreferenceController leAudioController =
|
||||
getDevelopmentOptionsController(
|
||||
BluetoothLeAudioHwOffloadPreferenceController.class);
|
||||
// If hardware offload isn't default value, we must reboot after disable
|
||||
// developer options. Show a dialog for the user to confirm.
|
||||
if (controller == null || controller.isDefaultValue()) {
|
||||
if ((a2dpController == null || a2dpController.isDefaultValue())
|
||||
&& (leAudioController == null || leAudioController.isDefaultValue())) {
|
||||
disableDeveloperOptions();
|
||||
} else {
|
||||
DisableDevSettingsDialogFragment.show(this /* host */);
|
||||
@@ -358,10 +362,27 @@ public class DevelopmentSettingsDashboardFragment extends RestrictedDashboardFra
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onA2dpHwDialogConfirmed() {
|
||||
final BluetoothA2dpHwOffloadPreferenceController controller =
|
||||
public void onHwOffloadDialogConfirmed() {
|
||||
final BluetoothA2dpHwOffloadPreferenceController a2dpController =
|
||||
getDevelopmentOptionsController(BluetoothA2dpHwOffloadPreferenceController.class);
|
||||
controller.onA2dpHwDialogConfirmed();
|
||||
a2dpController.onHwOffloadDialogConfirmed();
|
||||
|
||||
final BluetoothLeAudioHwOffloadPreferenceController leAudioController =
|
||||
getDevelopmentOptionsController(
|
||||
BluetoothLeAudioHwOffloadPreferenceController.class);
|
||||
leAudioController.onHwOffloadDialogConfirmed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onHwOffloadDialogCanceled() {
|
||||
final BluetoothA2dpHwOffloadPreferenceController a2dpController =
|
||||
getDevelopmentOptionsController(BluetoothA2dpHwOffloadPreferenceController.class);
|
||||
a2dpController.onHwOffloadDialogCanceled();
|
||||
|
||||
final BluetoothLeAudioHwOffloadPreferenceController leAudioController =
|
||||
getDevelopmentOptionsController(
|
||||
BluetoothLeAudioHwOffloadPreferenceController.class);
|
||||
leAudioController.onHwOffloadDialogCanceled();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -521,6 +542,7 @@ public class DevelopmentSettingsDashboardFragment extends RestrictedDashboardFra
|
||||
controllers.add(new BluetoothAvrcpVersionPreferenceController(context));
|
||||
controllers.add(new BluetoothMapVersionPreferenceController(context));
|
||||
controllers.add(new BluetoothA2dpHwOffloadPreferenceController(context, fragment));
|
||||
controllers.add(new BluetoothLeAudioHwOffloadPreferenceController(context, fragment));
|
||||
controllers.add(new BluetoothMaxConnectedAudioDevicesPreferenceController(context));
|
||||
controllers.add(new NfcStackDebugLogPreferenceController(context));
|
||||
controllers.add(new ShowTapsPreferenceController(context));
|
||||
|
Reference in New Issue
Block a user