Implement new dismissal behaviour of contextual card

Currently, if a contextual card gets dismissed, it will be gone forever.
After this change, all cards being dismissed can be shown again after a
certain amount of time(e.g one day). In order to calculate the amount of
time, CARD_DISMISSED column is replaced with DISMISSED_TIMESTAMP. Once a
card gets dismissed, a timestamp will be recorded for a corresponding
card.

In this change, some methods are moved from CardDatabaseHelper to
ContextualCardFeatureProvider. So OEMs could replace the providers with
their own ones to get cards and have different dismissal behaviours.

Bug: 143055685
Test: rototests
Change-Id: I00ace98991cabcbfcae4fc47a44e9448683d680c
This commit is contained in:
Yi-Ling Chuang
2020-02-18 09:16:10 +08:00
parent baf12eeb6d
commit deea015b65
10 changed files with 193 additions and 105 deletions

View File

@@ -66,7 +66,6 @@ public class FakeFeatureFactory extends FeatureFactory {
public final UserFeatureProvider userFeatureProvider;
public final AssistGestureFeatureProvider assistGestureFeatureProvider;
public final AccountFeatureProvider mAccountFeatureProvider;
public final ContextualCardFeatureProvider mContextualCardFeatureProvider;
public final BluetoothFeatureProvider mBluetoothFeatureProvider;
public final AwareFeatureProvider mAwareFeatureProvider;
public final FaceFeatureProvider mFaceFeatureProvider;
@@ -74,6 +73,7 @@ public class FakeFeatureFactory extends FeatureFactory {
public PanelFeatureProvider panelFeatureProvider;
public SlicesFeatureProvider slicesFeatureProvider;
public SearchFeatureProvider searchFeatureProvider;
public ContextualCardFeatureProvider mContextualCardFeatureProvider;
/**
* Call this in {@code @Before} method of the test class to use fake factory.