Merge "[ConnectedDevicePage] Clean up flag enable_saved_devices_order_by_recency" into main
This commit is contained in:
@@ -31,8 +31,6 @@ import android.bluetooth.BluetoothManager;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.platform.test.annotations.RequiresFlagsDisabled;
|
||||
import android.platform.test.annotations.RequiresFlagsEnabled;
|
||||
import android.platform.test.flag.junit.CheckFlagsRule;
|
||||
import android.platform.test.flag.junit.DeviceFlagsValueProvider;
|
||||
import android.util.Pair;
|
||||
@@ -47,7 +45,6 @@ import com.android.settings.bluetooth.BluetoothDevicePreference;
|
||||
import com.android.settings.bluetooth.BluetoothDeviceUpdater;
|
||||
import com.android.settings.connecteddevice.dock.DockUpdater;
|
||||
import com.android.settings.dashboard.DashboardFragment;
|
||||
import com.android.settings.flags.Flags;
|
||||
import com.android.settings.testutils.shadow.ShadowBluetoothAdapter;
|
||||
import com.android.settings.widget.SingleTargetGearPreference;
|
||||
import com.android.settingslib.bluetooth.CachedBluetoothDevice;
|
||||
@@ -267,19 +264,17 @@ public class PreviouslyConnectedDevicePreferenceControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresFlagsDisabled(Flags.FLAG_ENABLE_SAVED_DEVICES_ORDER_BY_RECENCY)
|
||||
public void onDeviceAdded_addPreferenceNotExistInRecentlyDevices_noCrash() {
|
||||
final BluetoothDevicePreference preference = new BluetoothDevicePreference(
|
||||
mContext, mCachedDevice5, true, BluetoothDevicePreference.SortType.TYPE_NO_SORT);
|
||||
|
||||
mPreConnectedDeviceController.onDeviceAdded(preference);
|
||||
|
||||
// 1 BluetoothDevicePreference and 1 see all preference
|
||||
assertThat(mPreferenceGroup.getPreferenceCount()).isEqualTo(2);
|
||||
// 1 see all preference
|
||||
assertThat(mPreferenceGroup.getPreferenceCount()).isEqualTo(1);
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresFlagsEnabled(Flags.FLAG_ENABLE_SAVED_DEVICES_ORDER_BY_RECENCY)
|
||||
public void onDeviceAdded_addPreferenceNotExistInRecentlyDevices_doNothing() {
|
||||
final BluetoothDevicePreference preference = new BluetoothDevicePreference(
|
||||
mContext, mCachedDevice5, true, BluetoothDevicePreference.SortType.TYPE_NO_SORT);
|
||||
@@ -325,7 +320,6 @@ public class PreviouslyConnectedDevicePreferenceControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresFlagsEnabled(Flags.FLAG_ENABLE_SAVED_DEVICES_ORDER_BY_RECENCY)
|
||||
public void updatePreferenceGroup_bluetoothIsEnable_shouldOrderByMostRecentlyConnected() {
|
||||
when(mBluetoothAdapter.isEnabled()).thenReturn(true);
|
||||
final BluetoothDevicePreference preference4 =
|
||||
@@ -361,7 +355,6 @@ public class PreviouslyConnectedDevicePreferenceControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresFlagsEnabled(Flags.FLAG_ENABLE_SAVED_DEVICES_ORDER_BY_RECENCY)
|
||||
public void updatePreferenceGroup_bluetoothIsDisable_shouldShowOnlySeeAllPreference() {
|
||||
when(mBluetoothAdapter.isEnabled()).thenReturn(false);
|
||||
final BluetoothDevicePreference preference4 =
|
||||
|
@@ -31,7 +31,6 @@ import android.bluetooth.BluetoothManager;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.platform.test.annotations.RequiresFlagsEnabled;
|
||||
import android.platform.test.flag.junit.CheckFlagsRule;
|
||||
import android.platform.test.flag.junit.DeviceFlagsValueProvider;
|
||||
import android.util.Pair;
|
||||
@@ -45,7 +44,6 @@ import com.android.settings.bluetooth.BluetoothDevicePreference;
|
||||
import com.android.settings.bluetooth.BluetoothDeviceUpdater;
|
||||
import com.android.settings.connecteddevice.dock.DockUpdater;
|
||||
import com.android.settings.dashboard.DashboardFragment;
|
||||
import com.android.settings.flags.Flags;
|
||||
import com.android.settingslib.bluetooth.CachedBluetoothDevice;
|
||||
import com.android.settingslib.core.lifecycle.Lifecycle;
|
||||
|
||||
@@ -177,7 +175,6 @@ public class SavedDeviceGroupControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresFlagsEnabled(Flags.FLAG_ENABLE_SAVED_DEVICES_ORDER_BY_RECENCY)
|
||||
public void updatePreferenceGroup_bluetoothIsEnable_shouldOrderByMostRecentlyConnected() {
|
||||
when(mBluetoothAdapter.isEnabled()).thenReturn(true);
|
||||
final BluetoothDevicePreference preference3 =
|
||||
@@ -213,7 +210,6 @@ public class SavedDeviceGroupControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresFlagsEnabled(Flags.FLAG_ENABLE_SAVED_DEVICES_ORDER_BY_RECENCY)
|
||||
public void updatePreferenceGroup_bluetoothIsDisable_shouldShowNoPreference() {
|
||||
when(mBluetoothAdapter.isEnabled()).thenReturn(false);
|
||||
final BluetoothDevicePreference preference3 =
|
||||
|
Reference in New Issue
Block a user