Supported updated suggestion cards in AOSP Settings

Flag: com.android.settings.flags.updated_suggestion_card_aosp
Bug: 323258154
Test: Enable flag and trigger suggestion cards to show
Change-Id: Iee47d05d8d75c10ba073ae3541f108bc37b4c09b
This commit is contained in:
Chris Antol
2024-08-01 09:01:49 +00:00
parent 4c90aa7404
commit 468e15f49a
11 changed files with 438 additions and 6 deletions

View File

@@ -276,7 +276,8 @@ public class SettingsHomepageActivity extends FragmentActivity implements
final boolean scrollNeeded = mIsEmbeddingActivityEnabled
&& !TextUtils.equals(getString(DEFAULT_HIGHLIGHT_MENU_KEY), highlightMenuKey);
showSuggestionFragment(scrollNeeded);
if (FeatureFlagUtils.isEnabled(this, FeatureFlags.CONTEXTUAL_HOME)) {
if (!Flags.updatedSuggestionCardAosp()
&& FeatureFlagUtils.isEnabled(this, FeatureFlags.CONTEXTUAL_HOME)) {
showFragment(() -> new ContextualCardsFragment(), R.id.contextual_cards_content);
((FrameLayout) findViewById(R.id.main_content))
.getLayoutTransition().enableTransitionType(LayoutTransition.CHANGING);
@@ -477,7 +478,7 @@ public class SettingsHomepageActivity extends FragmentActivity implements
private void showSuggestionFragment(boolean scrollNeeded) {
final Class<? extends Fragment> fragmentClass = FeatureFactory.getFeatureFactory()
.getSuggestionFeatureProvider().getContextualSuggestionFragment();
.getSuggestionFeatureProvider().getSuggestionFragment();
if (fragmentClass == null) {
return;
}