Use a better way to bind slice for slice precheck.
Calling Slice.bindSlice() directly will cause the exception stating that slices are not pinned, which sometimes leads to crash. Hence, change the way we bind slices which handles pinSlice() for us before onBindSlice(). Bug: 120552892 Test: robotests, unit tests Change-Id: I3e65c6b79876dbee5db6f19387bc6b675f734161
This commit is contained in:
@@ -73,15 +73,6 @@ public class ContextualCardLoaderTest {
|
||||
getContextualCard(sliceUri))).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void isCardEligibleToDisplay_noProvider_returnFalse() {
|
||||
final String sliceUri = "content://com.android.settings.test.slices/action/flashlight";
|
||||
|
||||
assertThat(
|
||||
mContextualCardLoader.isCardEligibleToDisplay(
|
||||
getContextualCard(sliceUri))).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getDisplayableCards_twoEligibleCards_shouldShowAll() {
|
||||
final List<ContextualCard> cards = getContextualCardList().stream().limit(2)
|
||||
|
Reference in New Issue
Block a user