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

Commit 859d0d87 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Simplifying some test utility methods" into udc-qpr-dev

parents 1373c900 ee974046
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -858,8 +858,11 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
                .setDuration(isStashed ? duration / 2 : duration));
    }

    private static void play(AnimatorSet as, Animator a, long startDelay, long duration,
    private static void play(AnimatorSet as, @Nullable Animator a, long startDelay, long duration,
            Interpolator interpolator) {
        if (a == null) {
            return;
        }
        a.setDuration(duration);
        a.setStartDelay(startDelay);
        a.setInterpolator(interpolator);
+1 −1
Original line number Diff line number Diff line
@@ -187,7 +187,7 @@ public class ViewInflationDuringSwipeUp extends AbstractQuickStepTest {
                    LauncherSettings.Settings.METHOD_CREATE_EMPTY_DB);
            LauncherSettings.Settings.call(mResolver,
                    LauncherSettings.Settings.METHOD_CLEAR_EMPTY_DB_FLAG);
            LauncherAppWidgetProviderInfo info = TestViewHelpers.findWidgetProvider(this, false);
            LauncherAppWidgetProviderInfo info = TestViewHelpers.findWidgetProvider(false);
            // Make sure the widget is big enough to show a list of items
            info.minSpanX = 2;
            info.minSpanY = 2;
+4 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import android.text.TextUtils;
import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.LauncherPrefs;
import com.android.launcher3.logging.StatsLogManager.LauncherEvent;
import com.android.launcher3.util.MainThreadInitializedObject.SandboxContext;

import java.util.Locale;
import java.util.Objects;
@@ -92,6 +93,9 @@ public class DeviceGridState implements Comparable<DeviceGridState> {
     * Stores the device state to shared preferences
     */
    public void writeToPrefs(Context context) {
        if (context instanceof SandboxContext) {
            return;
        }
        LauncherPrefs.get(context).put(
                WORKSPACE_SIZE.to(mGridSizeString),
                HOTSEAT_COUNT.to(mNumHotseat),
+2 −5
Original line number Diff line number Diff line
@@ -45,7 +45,6 @@ import com.android.launcher3.pm.InstallSessionHelper;
import com.android.launcher3.provider.LauncherDbUtils.SQLiteTransaction;
import com.android.launcher3.util.GridOccupancy;
import com.android.launcher3.util.IntArray;
import com.android.launcher3.util.MainThreadInitializedObject.SandboxContext;
import com.android.launcher3.widget.LauncherAppWidgetProviderInfo;
import com.android.launcher3.widget.WidgetManagerHelper;

@@ -133,12 +132,10 @@ public class GridSizeMigrationUtil {
            Log.v(TAG, "Workspace migration completed in "
                    + (System.currentTimeMillis() - migrationStartTime));

            if (!(context instanceof SandboxContext)) {
            // Save current configuration, so that the migration does not run again.
            destDeviceState.writeToPrefs(context);
        }
    }
    }

    public static boolean migrate(
            @NonNull DatabaseHelper helper,
+2 −11
Original line number Diff line number Diff line
@@ -367,18 +367,9 @@ public class LoaderTask implements Runnable {
        final boolean isSdCardReady = Utilities.isBootCompleted();
        final WidgetManagerHelper widgetHelper = new WidgetManagerHelper(context);

        boolean clearDb = false;
        if (!mApp.getModel().getModelDbController().migrateGridIfNeeded()) {
            // Migration failed. Clear workspace.
            clearDb = true;
        }

        if (clearDb) {
            Log.d(TAG, "loadWorkspace: resetting launcher database");
            Settings.call(contentResolver, Settings.METHOD_CREATE_EMPTY_DB);
        }

        mApp.getModel().getModelDbController().tryMigrateDB();
        Log.d(TAG, "loadWorkspace: loading default favorites");
        mApp.getModel().getModelDbController().loadDefaultFavoritesIfNecessary();
        Settings.call(contentResolver, Settings.METHOD_LOAD_DEFAULT_FAVORITES);

        synchronized (mBgDataModel) {
Loading