Remove allowlist reboot behavior
As we switch to use allowlist or bypass it, it would only impact the
default connection after the paring. So based on it, we don't need to
force device reboot to apply the setting
Bug: 300012501
Test: m SettingsGoogle
Change-Id: I0b63a68e1263692e922968c122b96b5635b9861f
diff --git a/src/com/android/settings/development/BluetoothLeAudioAllowListPreferenceController.java b/src/com/android/settings/development/BluetoothLeAudioAllowListPreferenceController.java
index 013124e..532db85 100644
--- a/src/com/android/settings/development/BluetoothLeAudioAllowListPreferenceController.java
+++ b/src/com/android/settings/development/BluetoothLeAudioAllowListPreferenceController.java
@@ -49,9 +49,6 @@
private final DevelopmentSettingsDashboardFragment mFragment;
- @VisibleForTesting
- boolean mChanged = false;
-
public BluetoothLeAudioAllowListPreferenceController(Context context,
DevelopmentSettingsDashboardFragment fragment) {
super(context);
@@ -66,8 +63,6 @@
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
- BluetoothRebootDialog.show(mFragment);
- mChanged = true;
return false;
}
@@ -92,25 +87,4 @@
((SwitchPreference) mPreference).setChecked(false);
}
}
-
- /**
- * Called when the RebootDialog confirm is clicked.
- */
- public void onRebootDialogConfirmed() {
- if (!mChanged) {
- return;
- }
-
- final boolean leAudioAllowListEnabled =
- SystemProperties.getBoolean(LE_AUDIO_ALLOW_LIST_ENABLED_PROPERTY, false);
- SystemProperties.set(LE_AUDIO_ALLOW_LIST_ENABLED_PROPERTY,
- Boolean.toString(leAudioAllowListEnabled));
- }
-
- /**
- * Called when the RebootDialog cancel is clicked.
- */
- public void onRebootDialogCanceled() {
- mChanged = false;
- }
}
diff --git a/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java b/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java
index 47b9d09..f0cf59a 100644
--- a/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java
+++ b/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java
@@ -442,11 +442,6 @@
getDevelopmentOptionsController(
BluetoothLeAudioPreferenceController.class);
leAudioFeatureController.onRebootDialogConfirmed();
-
- final BluetoothLeAudioAllowListPreferenceController leAudioAllowListController =
- getDevelopmentOptionsController(
- BluetoothLeAudioAllowListPreferenceController.class);
- leAudioAllowListController.onRebootDialogConfirmed();
}
@Override
@@ -464,11 +459,6 @@
getDevelopmentOptionsController(
BluetoothLeAudioPreferenceController.class);
leAudioFeatureController.onRebootDialogCanceled();
-
- final BluetoothLeAudioAllowListPreferenceController leAudioAllowListController =
- getDevelopmentOptionsController(
- BluetoothLeAudioAllowListPreferenceController.class);
- leAudioAllowListController.onRebootDialogCanceled();
}
@Override
diff --git a/tests/robotests/src/com/android/settings/development/BluetoothLeAudioAllowListPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/BluetoothLeAudioAllowListPreferenceControllerTest.java
index f4e52ba..d85d522 100644
--- a/tests/robotests/src/com/android/settings/development/BluetoothLeAudioAllowListPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/BluetoothLeAudioAllowListPreferenceControllerTest.java
@@ -18,23 +18,16 @@
import static android.bluetooth.BluetoothStatusCodes.FEATURE_SUPPORTED;
-import static com.android.settings.development.BluetoothLeAudioAllowListPreferenceController
- .LE_AUDIO_ALLOW_LIST_ENABLED_PROPERTY;
-
-import static com.google.common.truth.Truth.assertThat;
-
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when;
import android.bluetooth.BluetoothAdapter;
import android.content.Context;
-import android.os.SystemProperties;
import androidx.preference.PreferenceScreen;
import androidx.preference.SwitchPreference;
import org.junit.Before;
-import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@@ -69,38 +62,4 @@
when(mBluetoothAdapter.isLeAudioSupported())
.thenReturn(FEATURE_SUPPORTED);
}
-
- @Test
- public void onRebootDialogConfirmedAsLeAudioAllowListDisabled_shouldSwitchStatus() {
- SystemProperties.set(LE_AUDIO_ALLOW_LIST_ENABLED_PROPERTY, Boolean.toString(false));
- mController.mChanged = true;
-
- mController.onRebootDialogConfirmed();
- final boolean mode = SystemProperties.getBoolean(
- LE_AUDIO_ALLOW_LIST_ENABLED_PROPERTY, false);
- assertThat(mode).isFalse();
- }
-
-
- @Test
- public void onRebootDialogConfirmedAsLeAudioAllowListEnabled_shouldSwitchStatus() {
- SystemProperties.set(LE_AUDIO_ALLOW_LIST_ENABLED_PROPERTY, Boolean.toString(true));
- mController.mChanged = true;
-
- mController.onRebootDialogConfirmed();
- final boolean status = SystemProperties.getBoolean(
- LE_AUDIO_ALLOW_LIST_ENABLED_PROPERTY, false);
- assertThat(status).isTrue();
- }
-
- @Test
- public void onRebootDialogCanceled_shouldNotSwitchStatus() {
- SystemProperties.set(LE_AUDIO_ALLOW_LIST_ENABLED_PROPERTY, Boolean.toString(false));
- mController.mChanged = true;
-
- mController.onRebootDialogCanceled();
- final boolean status = SystemProperties.getBoolean(
- LE_AUDIO_ALLOW_LIST_ENABLED_PROPERTY, false);
- assertThat(status).isFalse();
- }
}