/packages/apps/Settings/tests/robotests/src/com/android/settings/homepage/contextualcards/ |
D | ContextualCardManagerTest.java | 130 .map(ContextualCard::getName) in constructor_hasSavedInstanceState_shouldContainExpectedSavedCards() 149 final List<Integer> expected = Arrays.asList(ContextualCard.CardType.CONDITIONAL, in constructor_hasSettingsCustomCards_shouldSetUpCustomControllers() 150 ContextualCard.CardType.LEGACY_SUGGESTION); in constructor_hasSettingsCustomCards_shouldSetUpCustomControllers() 178 final int[] expected = {ContextualCard.CardType.CONDITIONAL, in getSettingsCards_conditionalsEnabled_shouldContainLegacyAndConditionals() 179 ContextualCard.CardType.LEGACY_SUGGESTION}; in getSettingsCards_conditionalsEnabled_shouldContainLegacyAndConditionals() 189 final int[] expected = {ContextualCard.CardType.LEGACY_SUGGESTION}; in getSettingsCards_conditionalsDisabled_shouldContainLegacy() 201 mManager.setupController(ContextualCard.CardType.SLICE); in setupController_notLifecycleObserverInstance_shouldNotAttachToLifecycle() 209 final List<ContextualCard> cards = new ArrayList<>(); in sortCards_shouldBeDescendingOrder() 210 final ContextualCard card1 = in sortCards_shouldBeDescendingOrder() 212 final ContextualCard card2 = in sortCards_shouldBeDescendingOrder() [all …]
|
D | ContextualCardLoaderTest.java | 20 import static com.android.settings.intelligence.ContextualCardProto.ContextualCard.Category.STICKY_… 75 final List<ContextualCard> cards = getContextualCardList().stream().limit(2) in getDisplayableCards_twoEligibleCards_shouldShowAll() 79 final List<ContextualCard> result = mContextualCardLoader.getDisplayableCards(cards); in getDisplayableCards_twoEligibleCards_shouldShowAll() 86 final List<ContextualCard> cards = getContextualCardList().stream().limit(4) in getDisplayableCards_fourEligibleCards_shouldShowDefaultCardCount() 90 final List<ContextualCard> result = mContextualCardLoader.getDisplayableCards(cards); in getDisplayableCards_fourEligibleCards_shouldShowDefaultCardCount() 97 final List<ContextualCard> cards = getContextualCardList().stream().limit(5) in getDisplayableCards_oneStickyCard_shouldShowOneStickyCardAtTheTail() 101 final List<ContextualCard> result = mContextualCardLoader.getDisplayableCards(cards); in getDisplayableCards_oneStickyCard_shouldShowOneStickyCardAtTheTail() 109 final List<ContextualCard> cards = getContextualCardList(); in getDisplayableCards_threeStickyCards_shouldShowThreeStickyCardAtTheTail() 112 final List<ContextualCard> result = mContextualCardLoader.getDisplayableCards(cards); in getDisplayableCards_threeStickyCards_shouldShowThreeStickyCardAtTheTail() 154 private List<ContextualCard> getContextualCardList() { in getContextualCardList() [all …]
|
D | ContextualCardsAdapterTest.java | 81 final List<ContextualCard> cards = getContextualCardList(); in getItemCount_cardList_shouldReturnListSize() 117 final Map<Integer, List<ContextualCard>> cardsToUpdate = new ArrayMap<>(); in onContextualCardUpdated_emptyList_shouldClearCardList() 118 final List<ContextualCard> newCardList = new ArrayList<>(); in onContextualCardUpdated_emptyList_shouldClearCardList() 119 cardsToUpdate.put(ContextualCard.CardType.DEFAULT, newCardList); in onContextualCardUpdated_emptyList_shouldClearCardList() 129 final Map<Integer, List<ContextualCard>> cardsToUpdate = new ArrayMap<>(); in onContextualCardUpdated_newCardList_shouldUpdateCardList() 130 final List<ContextualCard> newCardList = new ArrayList<>(); in onContextualCardUpdated_newCardList_shouldUpdateCardList() 132 cardsToUpdate.put(ContextualCard.CardType.DEFAULT, newCardList); in onContextualCardUpdated_newCardList_shouldUpdateCardList() 149 private List<ContextualCard> getContextualCardList() { in getContextualCardList() 150 final List<ContextualCard> cards = new ArrayList<>(); in getContextualCardList() 151 cards.add(new ContextualCard.Builder() in getContextualCardList() [all …]
|
D | ContextualCardsDiffCallbackTest.java | 19 import static com.android.settings.intelligence.ContextualCardProto.ContextualCard.Category.IMPORTA… 20 import static com.android.settings.intelligence.ContextualCardProto.ContextualCard.Category.STICKY_… 40 private List<ContextualCard> mOldCards; 41 private List<ContextualCard> mNewCards; 82 final ContextualCard card = getContextualCard("test1").mutate() in areContentsTheSame_sliceWithToggle_returnFalse() 91 final ContextualCard card = getContextualCard("test1").mutate() in areContentsTheSame_stickySlice_returnFalse() 100 final ContextualCard card = getContextualCard("test1").mutate() in areContentsTheSame_importantSlice_returnFalse() 107 private ContextualCard getContextualCard(String name) { in getContextualCard() 108 return new ContextualCard.Builder() in getContextualCard() 111 .setCardType(ContextualCard.CardType.SLICE) in getContextualCard()
|
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/homepage/contextualcards/ |
D | ContextualCardManager.java | 20 import static com.android.car.developeroptions.intelligence.ContextualCardProto.ContextualCard.Cate… 21 import static com.android.car.developeroptions.intelligence.ContextualCardProto.ContextualCard.Cate… 82 {ContextualCard.CardType.CONDITIONAL, ContextualCard.CardType.LEGACY_SUGGESTION}; 91 final List<ContextualCard> mContextualCards; 113 for (@ContextualCard.CardType int cardType : SETTINGS_CARDS) { in ContextualCardManager() 129 for (ContextualCard card : mContextualCards) { in loadCardControllers() 135 void setupController(@ContextualCard.CardType int cardType) { in setupController() 150 List<ContextualCard> sortCards(List<ContextualCard> cards) { in sortCards() 158 public void onContextualCardUpdated(Map<Integer, List<ContextualCard>> updateList) { in onContextualCardUpdated() 161 List<ContextualCard> cardsToKeep; in onContextualCardUpdated() [all …]
|
D | SettingsContextualCardProvider.java | 21 import com.android.car.developeroptions.intelligence.ContextualCardProto.ContextualCard; 32 final ContextualCard wifiCard = in getContextualCards() 33 ContextualCard.newBuilder() in getContextualCards() 36 .setCardCategory(ContextualCard.Category.IMPORTANT) in getContextualCards() 38 final ContextualCard connectedDeviceCard = in getContextualCards() 39 ContextualCard.newBuilder() in getContextualCards() 42 .setCardCategory(ContextualCard.Category.IMPORTANT) in getContextualCards() 44 final ContextualCard lowStorageCard = in getContextualCards() 45 ContextualCard.newBuilder() in getContextualCards() 48 .setCardCategory(ContextualCard.Category.IMPORTANT) in getContextualCards() [all …]
|
D | ContextualCardLoader.java | 50 public class ContextualCardLoader extends AsyncLoaderCompat<List<ContextualCard>> { 99 protected void onDiscardResult(List<ContextualCard> result) { in onDiscardResult() 105 public List<ContextualCard> loadInBackground() { in loadInBackground() 106 final List<ContextualCard> result = new ArrayList<>(); in loadInBackground() 114 final ContextualCard card = new ContextualCard(cursor); in loadInBackground() 130 List<ContextualCard> getDisplayableCards(List<ContextualCard> candidates) { in getDisplayableCards() 131 final List<ContextualCard> eligibleCards = filterEligibleCards(candidates); in getDisplayableCards() 132 final List<ContextualCard> visibleCards = new ArrayList<>(); in getDisplayableCards() 133 final List<ContextualCard> hiddenCards = new ArrayList<>(); in getDisplayableCards() 188 List<ContextualCard> filterEligibleCards(List<ContextualCard> candidates) { in filterEligibleCards() [all …]
|
/packages/apps/Settings/src/com/android/settings/homepage/contextualcards/ |
D | ContextualCardManager.java | 20 import static com.android.settings.intelligence.ContextualCardProto.ContextualCard.Category.STICKY_… 21 import static com.android.settings.intelligence.ContextualCardProto.ContextualCard.Category.SUGGEST… 93 final List<ContextualCard> mContextualCards; 115 for (@ContextualCard.CardType int cardType : getSettingsCards()) { in ContextualCardManager() 143 for (ContextualCard card : mContextualCards) { in loadCardControllers() 151 return new int[] {ContextualCard.CardType.LEGACY_SUGGESTION}; in getSettingsCards() 154 {ContextualCard.CardType.CONDITIONAL, ContextualCard.CardType.LEGACY_SUGGESTION}; in getSettingsCards() 158 void setupController(@ContextualCard.CardType int cardType) { in setupController() 173 List<ContextualCard> sortCards(List<ContextualCard> cards) { in sortCards() 175 final List<ContextualCard> result = cards.stream() in sortCards() [all …]
|
D | SettingsContextualCardProvider.java | 21 import com.android.settings.intelligence.ContextualCardProto.ContextualCard; 35 final ContextualCard wifiCard = in getContextualCards() 36 ContextualCard.newBuilder() in getContextualCards() 39 .setCardCategory(ContextualCard.Category.IMPORTANT) in getContextualCards() 41 final ContextualCard connectedDeviceCard = in getContextualCards() 42 ContextualCard.newBuilder() in getContextualCards() 45 .setCardCategory(ContextualCard.Category.IMPORTANT) in getContextualCards() 47 final ContextualCard lowStorageCard = in getContextualCards() 48 ContextualCard.newBuilder() in getContextualCards() 51 .setCardCategory(ContextualCard.Category.IMPORTANT) in getContextualCards() [all …]
|
D | ContextualCardLoader.java | 19 import static com.android.settings.intelligence.ContextualCardProto.ContextualCard.Category.STICKY_… 50 public class ContextualCardLoader extends AsyncLoaderCompat<List<ContextualCard>> { 99 protected void onDiscardResult(List<ContextualCard> result) { in onDiscardResult() 105 public List<ContextualCard> loadInBackground() { in loadInBackground() 106 final List<ContextualCard> result = new ArrayList<>(); in loadInBackground() 114 final ContextualCard card = new ContextualCard(cursor); in loadInBackground() 128 List<ContextualCard> getDisplayableCards(List<ContextualCard> candidates) { in getDisplayableCards() 129 final List<ContextualCard> eligibleCards = filterEligibleCards(candidates); in getDisplayableCards() 130 final List<ContextualCard> stickyCards = new ArrayList<>(); in getDisplayableCards() 131 final List<ContextualCard> visibleCards = new ArrayList<>(); in getDisplayableCards() [all …]
|
D | ContextualCardsDiffCallback.java | 19 import static com.android.settings.intelligence.ContextualCardProto.ContextualCard.Category.IMPORTA… 20 import static com.android.settings.intelligence.ContextualCardProto.ContextualCard.Category.STICKY_… 31 private final List<ContextualCard> mOldCards; 32 private final List<ContextualCard> mNewCards; 34 public ContextualCardsDiffCallback(List<ContextualCard> oldCards, in ContextualCardsDiffCallback() 35 List<ContextualCard> newCards) { in ContextualCardsDiffCallback() 58 final ContextualCard newCard = mNewCards.get(newCardPosition); in areContentsTheSame()
|
/packages/apps/Settings/src/com/android/settings/homepage/contextualcards/conditional/ |
D | ConditionContextualCardController.java | 24 import com.android.settings.homepage.contextualcards.ContextualCard; 73 return ContextualCard.CardType.CONDITIONAL; in getCardType() 87 public void onPrimaryClick(ContextualCard contextualCard) { in onPrimaryClick() 93 public void onActionClick(ContextualCard contextualCard) { in onActionClick() 99 public void onDismissed(ContextualCard contextualCard) { in onDismissed() 108 final List<ContextualCard> conditionCards = mConditionManager.getDisplayableCards(); in onConditionsChanged() 109 final Map<Integer, List<ContextualCard>> conditionalCards = in onConditionsChanged() 147 Map<Integer, List<ContextualCard>> buildConditionalCardsWithFooterOrHeader( in buildConditionalCardsWithFooterOrHeader() 148 List<ContextualCard> conditionCards) { in buildConditionalCardsWithFooterOrHeader() 149 final Map<Integer, List<ContextualCard>> conditionalCards = new ArrayMap<>(); in buildConditionalCardsWithFooterOrHeader() [all …]
|
D | ConditionHeaderContextualCard.java | 21 import com.android.settings.homepage.contextualcards.ContextualCard; 32 public class ConditionHeaderContextualCard extends ContextualCard { 34 private final List<ContextualCard> mConditionalCards; 46 public List<ContextualCard> getConditionalCards() { in getConditionalCards() 69 public static class Builder extends ContextualCard.Builder { 71 private List<ContextualCard> mConditionalCards; 73 public Builder setConditionalCards(List<ContextualCard> conditionalCards) { in setConditionalCards()
|
D | ConditionManager.java | 25 import com.android.settings.homepage.contextualcards.ContextualCard; 59 public List<ContextualCard> getDisplayableCards() { in getDisplayableCards() 60 final List<ContextualCard> cards = new ArrayList<>(); in getDisplayableCards() 61 final List<Future<ContextualCard>> displayableCards = new ArrayList<>(); in getDisplayableCards() 68 for (Future<ContextualCard> cardFuture : displayableCards) { in getDisplayableCards() 70 final ContextualCard card = cardFuture.get( in getDisplayableCards() 168 public static class DisplayableChecker implements Callable<ContextualCard> { 177 public ContextualCard call() throws Exception { in call()
|
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/homepage/contextualcards/conditional/ |
D | ConditionContextualCardController.java | 24 import com.android.car.developeroptions.homepage.contextualcards.ContextualCard; 73 return ContextualCard.CardType.CONDITIONAL; in getCardType() 87 public void onPrimaryClick(ContextualCard contextualCard) { in onPrimaryClick() 93 public void onActionClick(ContextualCard contextualCard) { in onActionClick() 99 public void onDismissed(ContextualCard contextualCard) { in onDismissed() 108 final List<ContextualCard> conditionCards = mConditionManager.getDisplayableCards(); in onConditionsChanged() 109 final Map<Integer, List<ContextualCard>> conditionalCards = in onConditionsChanged() 147 Map<Integer, List<ContextualCard>> buildConditionalCardsWithFooterOrHeader( in buildConditionalCardsWithFooterOrHeader() 148 List<ContextualCard> conditionCards) { in buildConditionalCardsWithFooterOrHeader() 149 final Map<Integer, List<ContextualCard>> conditionalCards = new ArrayMap<>(); in buildConditionalCardsWithFooterOrHeader() [all …]
|
D | ConditionHeaderContextualCard.java | 21 import com.android.car.developeroptions.homepage.contextualcards.ContextualCard; 32 public class ConditionHeaderContextualCard extends ContextualCard { 34 private final List<ContextualCard> mConditionalCards; 46 public List<ContextualCard> getConditionalCards() { in getConditionalCards() 69 public static class Builder extends ContextualCard.Builder { 71 private List<ContextualCard> mConditionalCards; 73 public Builder setConditionalCards(List<ContextualCard> conditionalCards) { in setConditionalCards()
|
D | ConditionManager.java | 25 import com.android.car.developeroptions.homepage.contextualcards.ContextualCard; 62 public List<ContextualCard> getDisplayableCards() { in getDisplayableCards() 63 final List<ContextualCard> cards = new ArrayList<>(); in getDisplayableCards() 64 final List<Future<ContextualCard>> displayableCards = new ArrayList<>(); in getDisplayableCards() 71 for (Future<ContextualCard> cardFuture : displayableCards) { in getDisplayableCards() 73 final ContextualCard card = cardFuture.get( in getDisplayableCards() 171 public static class DisplayableChecker implements Callable<ContextualCard> { 180 public ContextualCard call() throws Exception { in call()
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/homepage/contextualcards/conditional/ |
D | ConditionContextualCardControllerTest.java | 32 import com.android.settings.homepage.contextualcards.ContextualCard; 33 import com.android.settings.homepage.contextualcards.ContextualCard.CardType; 97 final ContextualCard fakeConditionalCard = new ConditionalContextualCard.Builder().build(); in onConditionsChanged_listenerIsSet_shouldUpdateData() 98 final List<ContextualCard> conditionalCards = new ArrayList<>(); in onConditionsChanged_listenerIsSet_shouldUpdateData() 110 final ContextualCard fakeConditionalCard = new ConditionalContextualCard.Builder().build(); in onConditionsChanged_listenerNotSet_shouldNotUpdateData() 111 final List<ContextualCard> conditionalCards = new ArrayList<>(); in onConditionsChanged_listenerNotSet_shouldNotUpdateData() 122 final Map<Integer, List<ContextualCard>> conditionalCards = in getConditionalCards_hasEmptyConditionCards_shouldReturnThreeEmptyList() 134 final Map<Integer, List<ContextualCard>> conditionalCards = in getConditionalCards_hasOneConditionCardAndExpanded_shouldGetOneFullWidthCard() 148 final Map<Integer, List<ContextualCard>> conditionalCards = in getConditionalCards_hasOneConditionCardAndCollapsed_shouldGetConditionalHeader() 160 final Map<Integer, List<ContextualCard>> conditionalCards = in getConditionalCards_hasTwoConditionCardsAndExpanded_shouldGetTwoHalfWidthCards() [all …]
|
D | ConditionHeaderContextualCardRendererTest.java | 32 import com.android.settings.homepage.contextualcards.ContextualCard; 72 final ContextualCard card = generateConditionHeaderContextualCard(); in bindView_shouldSetClickListener() 78 ContextualCard.CardType.CONDITIONAL_HEADER)).thenReturn(mController); in bindView_shouldSetClickListener() 90 final ContextualCard card = generateConditionHeaderContextualCard(); in bindView_clickView_shouldSetTrueToIsConditionExpanded() 96 ContextualCard.CardType.CONDITIONAL_HEADER)).thenReturn(mController); in bindView_clickView_shouldSetTrueToIsConditionExpanded() 107 private ContextualCard generateConditionHeaderContextualCard() { in generateConditionHeaderContextualCard() 116 private List<ContextualCard> generateConditionCards(int numberOfCondition) { in generateConditionCards() 117 final List<ContextualCard> conditionCards = new ArrayList<>(); in generateConditionCards()
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/homepage/contextualcards/legacysuggestion/ |
D | LegacySuggestionContextualCardRendererTest.java | 33 import com.android.settings.homepage.contextualcards.ContextualCard; 71 final ContextualCard card = buildContextualCard(); in bindView_shouldSetListener() 77 ContextualCard.CardType.LEGACY_SUGGESTION)).thenReturn(mController); in bindView_shouldSetListener() 89 final ContextualCard card = buildContextualCard(); in bindView_closeButton_shouldSetListener() 96 ContextualCard.CardType.LEGACY_SUGGESTION)).thenReturn(mController); in bindView_closeButton_shouldSetListener() 108 final ContextualCard card = buildContextualCard(); in viewClick_shouldInvokeControllerPrimaryClick() 114 ContextualCard.CardType.LEGACY_SUGGESTION)).thenReturn(mController); in viewClick_shouldInvokeControllerPrimaryClick() 121 verify(mController).onPrimaryClick(any(ContextualCard.class)); in viewClick_shouldInvokeControllerPrimaryClick() 128 final ContextualCard card = buildContextualCard(); in viewClick_closeButton_shouldInvokeControllerDismissClick() 135 ContextualCard.CardType.LEGACY_SUGGESTION)).thenReturn(mController); in viewClick_closeButton_shouldInvokeControllerDismissClick() [all …]
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/homepage/contextualcards/slices/ |
D | SliceContextualCardRendererTest.java | 43 import com.android.settings.homepage.contextualcards.ContextualCard; 149 final ContextualCard card = buildContextualCard( in bindView_isPendingDismiss_shouldShowDismissalView() 160 final ContextualCard card = buildContextualCard( in bindView_isPendingDismiss_shouldAddViewHolderToSet() 171 final ContextualCard card = buildContextualCard(TEST_SLICE_URI); in bindView_beforeSuccessfulSliceBinding_shouldHideSwipeBackground() 182 final ContextualCard card = buildContextualCard(TEST_SLICE_URI); in bindView_reuseViewHolder_shouldHideSwipeBackgroundBeforeSliceBinding() 198 final ContextualCard card = buildContextualCard( in viewClick_keepCard_shouldShowSlice() 212 final ContextualCard card = buildContextualCard( in viewClick_keepCard_shouldRemoveViewHolderFromSet() 226 final ContextualCard card = buildContextualCard( in viewClick_removeCard_shouldRemoveViewHolderFromSet() 231 ContextualCard.CardType.SLICE); in viewClick_removeCard_shouldRemoveViewHolderFromSet() 242 final ContextualCard contextualCard = buildContextualCard(TEST_SLICE_URI); in viewClick_removeCard_sliceLiveDataShouldRemoveObservers() [all …]
|
/packages/apps/Settings/src/com/android/settings/homepage/contextualcards/legacysuggestion/ |
D | LegacySuggestionContextualCardController.java | 29 import com.android.settings.homepage.contextualcards.ContextualCard; 50 final List<ContextualCard> mSuggestions; 76 return ContextualCard.CardType.LEGACY_SUGGESTION; in getCardType() 80 public void onPrimaryClick(ContextualCard card) { in onPrimaryClick() 89 public void onActionClick(ContextualCard card) { in onActionClick() 94 public void onDismissed(ContextualCard card) { in onDismissed() 143 final List<ContextualCard> cards = new ArrayList<>(); in loadSuggestions() 171 final Map<Integer, List<ContextualCard>> suggestionCards = new ArrayMap<>(); in updateAdapter() 172 suggestionCards.put(ContextualCard.CardType.LEGACY_SUGGESTION, mSuggestions); in updateAdapter()
|
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/homepage/contextualcards/legacysuggestion/ |
D | LegacySuggestionContextualCardController.java | 29 import com.android.car.developeroptions.homepage.contextualcards.ContextualCard; 72 return ContextualCard.CardType.LEGACY_SUGGESTION; in getCardType() 76 public void onPrimaryClick(ContextualCard card) { in onPrimaryClick() 85 public void onActionClick(ContextualCard card) { in onActionClick() 90 public void onDismissed(ContextualCard card) { in onDismissed() 136 final List<ContextualCard> cards = new ArrayList<>(); in loadSuggestions() 157 final Map<Integer, List<ContextualCard>> suggestionCards = new ArrayMap<>(); in loadSuggestions() 158 suggestionCards.put(ContextualCard.CardType.LEGACY_SUGGESTION, cards); in loadSuggestions()
|
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/homepage/contextualcards/slices/ |
D | SliceContextualCardController.java | 29 import com.android.car.developeroptions.homepage.contextualcards.ContextualCard; 55 return ContextualCard.CardType.SLICE; in getCardType() 59 public void onPrimaryClick(ContextualCard card) { in onPrimaryClick() 64 public void onActionClick(ContextualCard card) { in onActionClick() 69 public void onDismissed(ContextualCard card) { in onDismissed() 90 void showFeedbackDialog(ContextualCard card) { in showFeedbackDialog() 108 private String getSimpleCardName(ContextualCard card) { in getSimpleCardName()
|
/packages/apps/Settings/src/com/android/settings/homepage/contextualcards/slices/ |
D | SliceContextualCardController.java | 28 import com.android.settings.homepage.contextualcards.ContextualCard; 55 return ContextualCard.CardType.SLICE; in getCardType() 59 public void onPrimaryClick(ContextualCard card) { in onPrimaryClick() 64 public void onActionClick(ContextualCard card) { in onActionClick() 69 public void onDismissed(ContextualCard card) { in onDismissed() 91 void showFeedbackDialog(ContextualCard card) { in showFeedbackDialog() 109 private String getSimpleCardName(ContextualCard card) { in getSimpleCardName()
|