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

Commit 22a9c3cb authored by fbaron's avatar fbaron
Browse files

Add flag check for SMARTSPACE_AS_A_WIDGET to loadertask.java

Missing a flag check that is necessary in LoaderTask.java to prevent the code from running when the flag is off.

Bug: 300140279
Flag: SMARTSPACE_AS_A_WIDGET
Test: no test
Change-Id: Iaa89e8542475eb01f679f70734a61c13a3cde89f
parent b1122a4a
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.launcher3.model;

import static com.android.launcher3.BuildConfig.WIDGET_ON_FIRST_SCREEN;
import static com.android.launcher3.LauncherSettings.Favorites.TABLE_NAME;
import static com.android.launcher3.config.FeatureFlags.SMARTSPACE_AS_A_WIDGET;
import static com.android.launcher3.model.BgDataModel.Callbacks.FLAG_HAS_SHORTCUT_PERMISSION;
import static com.android.launcher3.model.BgDataModel.Callbacks.FLAG_QUIET_MODE_CHANGE_PERMISSION;
import static com.android.launcher3.model.BgDataModel.Callbacks.FLAG_QUIET_MODE_ENABLED;
@@ -298,7 +299,8 @@ public class LoaderTask implements Runnable {
            logASplit("bindWidgets");
            verifyNotStopped();

            if (LauncherPrefs.get(mApp.getContext()).get(LauncherPrefs.SHOULD_SHOW_SMARTSPACE)) {
            if (SMARTSPACE_AS_A_WIDGET.get() && LauncherPrefs.get(mApp.getContext())
                    .get(LauncherPrefs.SHOULD_SHOW_SMARTSPACE)) {
                mLauncherBinder.bindSmartspaceWidget();
                // Turn off pref.
                LauncherPrefs.get(mApp.getContext()).putSync(
@@ -309,6 +311,16 @@ public class LoaderTask implements Runnable {
                                .to(false));
                logASplit("bindSmartspaceWidget");
                verifyNotStopped();
            } else if (!SMARTSPACE_AS_A_WIDGET.get() && WIDGET_ON_FIRST_SCREEN
                    && !LauncherPrefs.get(mApp.getContext())
                    .get(LauncherPrefs.SHOULD_SHOW_SMARTSPACE)) {
                // Turn on pref.
                LauncherPrefs.get(mApp.getContext()).putSync(
                        LauncherPrefs.backedUpItem(
                                        LauncherPrefs.SHOULD_SHOW_SMARTSPACE_KEY,
                                        WIDGET_ON_FIRST_SCREEN,
                                        true)
                                .to(true));
            }

            if (FeatureFlags.CHANGE_MODEL_DELEGATE_LOADING_ORDER.get()) {