Bluetooth: Enable AVDTP Delay reports by default.
Bug: 32755225
Test: See that delay reports are enabled when connecting to device
Change-Id: Icba9be6fc8ba455d37df39d283e36129f6acb536
(cherry picked from commit a8cf0b9371
)
This commit is contained in:
@@ -16,7 +16,9 @@
|
||||
|
||||
package com.android.settings.development;
|
||||
|
||||
import static com.android.settings.development.BluetoothDelayReportsPreferenceController.BLUETOOTH_ENABLE_AVDTP_DELAY_REPORTS_PROPERTY;
|
||||
import static com.android.settings.development.BluetoothDelayReportsPreferenceController
|
||||
.BLUETOOTH_DISABLE_AVDTP_DELAY_REPORTS_PROPERTY;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static org.mockito.Mockito.spy;
|
||||
import static org.mockito.Mockito.when;
|
||||
@@ -57,11 +59,11 @@ public class BluetoothDelayReportsPreferenceControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onPreferenceChanged_settingEnabled_turnOnDelayReports() {
|
||||
public void onPreferenceChanged_settingDisabled_turnOnDelayReports() {
|
||||
mController.onPreferenceChange(mPreference, true /* new value */);
|
||||
|
||||
final boolean mode = SystemProperties.getBoolean(
|
||||
BLUETOOTH_ENABLE_AVDTP_DELAY_REPORTS_PROPERTY, false /* default */);
|
||||
BLUETOOTH_DISABLE_AVDTP_DELAY_REPORTS_PROPERTY, false /* default */);
|
||||
|
||||
assertThat(mode).isTrue();
|
||||
}
|
||||
@@ -71,14 +73,14 @@ public class BluetoothDelayReportsPreferenceControllerTest {
|
||||
mController.onPreferenceChange(mPreference, false /* new value */);
|
||||
|
||||
final boolean mode = SystemProperties.getBoolean(
|
||||
BLUETOOTH_ENABLE_AVDTP_DELAY_REPORTS_PROPERTY, false /* default */);
|
||||
BLUETOOTH_DISABLE_AVDTP_DELAY_REPORTS_PROPERTY, false /* default */);
|
||||
|
||||
assertThat(mode).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void updateState_settingEnabled_preferenceShouldBeChecked() {
|
||||
SystemProperties.set(BLUETOOTH_ENABLE_AVDTP_DELAY_REPORTS_PROPERTY,
|
||||
public void updateState_settingDisabled_preferenceShouldBeChecked() {
|
||||
SystemProperties.set(BLUETOOTH_DISABLE_AVDTP_DELAY_REPORTS_PROPERTY,
|
||||
Boolean.toString(true));
|
||||
mController.updateState(mPreference);
|
||||
|
||||
@@ -87,7 +89,7 @@ public class BluetoothDelayReportsPreferenceControllerTest {
|
||||
|
||||
@Test
|
||||
public void updateState_settingDisabled_preferenceShouldNotBeChecked() {
|
||||
SystemProperties.set(BLUETOOTH_ENABLE_AVDTP_DELAY_REPORTS_PROPERTY,
|
||||
SystemProperties.set(BLUETOOTH_DISABLE_AVDTP_DELAY_REPORTS_PROPERTY,
|
||||
Boolean.toString(false));
|
||||
mController.updateState(mPreference);
|
||||
|
||||
@@ -99,10 +101,10 @@ public class BluetoothDelayReportsPreferenceControllerTest {
|
||||
mController.onDeveloperOptionsDisabled();
|
||||
|
||||
final boolean mode = SystemProperties.getBoolean(
|
||||
BLUETOOTH_ENABLE_AVDTP_DELAY_REPORTS_PROPERTY, false /* default */);
|
||||
BLUETOOTH_DISABLE_AVDTP_DELAY_REPORTS_PROPERTY, false /* default */);
|
||||
|
||||
assertThat(mode).isFalse();
|
||||
assertThat(mPreference.isEnabled()).isFalse();
|
||||
assertThat(mPreference.isChecked()).isFalse();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user