Fix a bug where custom cards are not refresh when removed

When the last custom card for a specific type is removed,
onContextualCardUpdated should receive the cardtype info so we can
remove it from main data set.

- Reverted onContextualCardUpdated method signature back to before
- Force ConditionContextualCardController to send an empty list if
  everything is removed.

* Note: the update logic is pretty complicated to handle
  add/update/remove all together. In the future we should consider
  spliting the removal logic to simplify this area.

Change-Id: Ied688deb693ec33e0017be02cf5c743a754a6e61
Fixes: 115572494
Test: visual
This commit is contained in:
Fan Zhang
2018-09-14 10:42:14 -07:00
parent 29aaf62410
commit 45fc707474
6 changed files with 33 additions and 33 deletions

View File

@@ -82,7 +82,7 @@ public class ConditionContextualCardControllerTest {
mController.onConditionsChanged();
verify(mController).onDataUpdated(any());
verify(mListener).onContextualCardUpdated(any());
}
@Test
@@ -94,7 +94,7 @@ public class ConditionContextualCardControllerTest {
mController.onConditionsChanged();
verify(mController, never()).onDataUpdated(any());
verify(mListener, never()).onContextualCardUpdated(any());
}
private class FakeConditionalCard implements ConditionalCard {