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
This commit is contained in:
Alice Kuo
2023-10-05 05:28:36 +08:00
parent c41abccb0f
commit f8767cdd31
3 changed files with 0 additions and 77 deletions

View File

@@ -18,23 +18,16 @@ package com.android.settings.development;
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 @@ public class BluetoothLeAudioAllowListPreferenceControllerTest {
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();
}
}