Refactor WifiSlice to CustomSliceManager
Modify the WifiSliceCode to follow the pattern for Slices that do not match existing UI components. Test: robotests Bug: 80263568 Change-Id: Id69e019608777282f4b64ff945e8c30c97aaf577
This commit is contained in:
committed by
Matt Fritze
parent
3df19f92b0
commit
7f0a30226a
@@ -45,7 +45,7 @@ import com.android.settings.testutils.DatabaseTestUtils;
|
||||
import com.android.settings.testutils.FakeToggleController;
|
||||
import com.android.settings.testutils.SettingsRobolectricTestRunner;
|
||||
import com.android.settings.testutils.shadow.ShadowThreadUtils;
|
||||
import com.android.settings.wifi.WifiSliceBuilder;
|
||||
import com.android.settings.wifi.WifiSlice;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
@@ -94,7 +94,7 @@ public class SettingsSliceProviderTest {
|
||||
private SliceManager mManager;
|
||||
|
||||
private static final List<Uri> SPECIAL_CASE_PLATFORM_URIS = Arrays.asList(
|
||||
WifiSliceBuilder.WIFI_URI,
|
||||
WifiSlice.WIFI_URI,
|
||||
BluetoothSliceBuilder.BLUETOOTH_URI,
|
||||
LocationSliceBuilder.LOCATION_URI
|
||||
);
|
||||
@@ -448,9 +448,9 @@ public class SettingsSliceProviderTest {
|
||||
|
||||
@Test
|
||||
public void bindSlice_wifiSlice_returnsWifiSlice() {
|
||||
final Slice wifiSlice = mProvider.onBindSlice(WifiSliceBuilder.WIFI_URI);
|
||||
final Slice wifiSlice = mProvider.onBindSlice(WifiSlice.WIFI_URI);
|
||||
|
||||
assertThat(wifiSlice.getUri()).isEqualTo(WifiSliceBuilder.WIFI_URI);
|
||||
assertThat(wifiSlice.getUri()).isEqualTo(WifiSlice.WIFI_URI);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@@ -85,8 +85,9 @@ public class SliceBroadcastReceiverTest {
|
||||
mSearchFeatureProvider = new SearchFeatureProviderImpl();
|
||||
mFakeFeatureFactory = FakeFeatureFactory.setupForTest();
|
||||
mFakeFeatureFactory.searchFeatureProvider = mSearchFeatureProvider;
|
||||
CustomSliceManager manager = new CustomSliceManager(mContext);
|
||||
when(mFakeFeatureFactory.slicesFeatureProvider.getCustomSliceManager(any()))
|
||||
.thenReturn(new CustomSliceManager(mContext));
|
||||
.thenReturn(manager);
|
||||
mLoggingNameArgumentCatpor = ArgumentCaptor.forClass(Pair.class);
|
||||
mLoggingValueArgumentCatpor = ArgumentCaptor.forClass(Pair.class);
|
||||
}
|
||||
|
@@ -112,10 +112,14 @@ public class SpecialCaseSliceManagerTest {
|
||||
|
||||
static boolean backingData = false;
|
||||
|
||||
public FakeSliceable(Context context) {}
|
||||
final Context mContext;
|
||||
|
||||
public FakeSliceable(Context context) {
|
||||
mContext = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Slice getSlice(Context context) {
|
||||
public Slice getSlice() {
|
||||
return SLICE;
|
||||
}
|
||||
|
||||
@@ -133,5 +137,10 @@ public class SpecialCaseSliceManagerTest {
|
||||
public IntentFilter getIntentFilter() {
|
||||
return new IntentFilter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Intent getIntent() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user