Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dfd5e4fe authored by Daniel Hunt's avatar Daniel Hunt Committed by Ed Savage-Jones
Browse files

Skip loading contextual cards if legacy cards are used

This stops a jarring animation that occurs when returning to the
settings top level when legacy contextual cards are enabled and
shown at the top of the top level list,

Bug: 142936956
Test: Manual
Change-Id: I43605adf6f1bf63cc40157ac97c8e3295dd3cd99
parent 2501f6e2
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ import androidx.annotation.VisibleForTesting;
import androidx.loader.app.LoaderManager;
import androidx.loader.content.Loader;

import com.android.settings.R;
import com.android.settings.homepage.contextualcards.conditional.ConditionalCardController;
import com.android.settings.homepage.contextualcards.logging.ContextualCardLogUtils;
import com.android.settings.homepage.contextualcards.slices.SliceContextualCardRenderer;
@@ -119,6 +120,10 @@ public class ContextualCardManager implements ContextualCardLoader.CardContentLo
    }

    void loadContextualCards(LoaderManager loaderManager) {
        if (mContext.getResources().getBoolean(R.bool.config_use_legacy_suggestion)) {
            Log.w(TAG, "Legacy suggestion contextual card enabled, skipping contextual cards.");
            return;
        }
        mStartTime = System.currentTimeMillis();
        final CardContentLoaderCallbacks cardContentLoaderCallbacks =
                new CardContentLoaderCallbacks(mContext);