Remove the unused slices.
Remove the DataUsageSlice, DeviceInfoSlice and EmergencyInfoSlice. Fixes: 146994847 Test: robotest Change-Id: Ic840e9cc93e99b3c0a34eb6536401db34c98eca8
This commit is contained in:
@@ -36,7 +36,6 @@ import androidx.lifecycle.LiveData;
|
||||
import androidx.slice.Slice;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.slices.CustomSliceRegistry;
|
||||
import com.android.settings.testutils.FakeFeatureFactory;
|
||||
|
||||
import org.junit.Before;
|
||||
@@ -54,8 +53,6 @@ import java.util.Map;
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class PanelSlicesAdapterTest {
|
||||
|
||||
private static final Uri DATA_URI = CustomSliceRegistry.DATA_USAGE_SLICE_URI;
|
||||
|
||||
private Context mContext;
|
||||
private PanelFragment mPanelFragment;
|
||||
private PanelFeatureProvider mPanelFeatureProvider;
|
||||
@@ -96,18 +93,6 @@ public class PanelSlicesAdapterTest {
|
||||
mData.put(uri, liveData);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onCreateViewHolder_returnsSliceRowViewHolder() {
|
||||
addTestLiveData(DATA_URI);
|
||||
final PanelSlicesAdapter adapter =
|
||||
new PanelSlicesAdapter(mPanelFragment, mData, 0 /* metrics category */);
|
||||
final ViewGroup view = new FrameLayout(mContext);
|
||||
final PanelSlicesAdapter.SliceRowViewHolder viewHolder =
|
||||
adapter.onCreateViewHolder(view, 0);
|
||||
|
||||
assertThat(viewHolder.sliceView).isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sizeOfAdapter_shouldNotExceedMaxNum() {
|
||||
for (int i = 0; i < MAX_NUM_OF_SLICES + 2; i++) {
|
||||
@@ -126,22 +111,6 @@ public class PanelSlicesAdapterTest {
|
||||
assertThat(adapter.getData().size()).isEqualTo(MAX_NUM_OF_SLICES);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nonMediaOutputIndicatorSlice_shouldAllowDividerAboveAndBelow() {
|
||||
addTestLiveData(DATA_URI);
|
||||
final PanelSlicesAdapter adapter =
|
||||
new PanelSlicesAdapter(mPanelFragment, mData, 0 /* metrics category */);
|
||||
final int position = 0;
|
||||
final ViewGroup view = new FrameLayout(mContext);
|
||||
final PanelSlicesAdapter.SliceRowViewHolder viewHolder =
|
||||
adapter.onCreateViewHolder(view, 0 /* view type*/);
|
||||
|
||||
adapter.onBindViewHolder(viewHolder, position);
|
||||
|
||||
assertThat(viewHolder.isDividerAllowedAbove()).isTrue();
|
||||
assertThat(viewHolder.isDividerAllowedBelow()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void mediaOutputIndicatorSlice_shouldNotAllowDividerAbove() {
|
||||
addTestLiveData(MEDIA_OUTPUT_INDICATOR_SLICE_URI);
|
||||
@@ -157,4 +126,4 @@ public class PanelSlicesAdapterTest {
|
||||
|
||||
assertThat(viewHolder.isDividerAllowedAbove()).isFalse();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user