int id = mWorkspaceScreens.keyAt(i);
CellLayout cl = mWorkspaceScreens.valueAt(i);
// FIRST_SCREEN_ID can never be removed.
- if (((!FeatureFlags.QSB_ON_FIRST_SCREEN
- || SHOULD_SHOW_FIRST_PAGE_WIDGET)
- || id > FIRST_SCREEN_ID)
+ if ((!BuildConfig.QSB_ON_FIRST_SCREEN || id > FIRST_SCREEN_ID)
&& cl.getShortcutsAndWidgets().getChildCount() == 0) {
removeScreens.add(id);
}
diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java
index d987841410..e10c41ba4a 100644
--- a/src/com/android/launcher3/config/FeatureFlags.java
+++ b/src/com/android/launcher3/config/FeatureFlags.java
@@ -44,14 +44,6 @@ public final class FeatureFlags {
@Deprecated
public static final boolean IS_STUDIO_BUILD = BuildConfig.IS_STUDIO_BUILD;
- /**
- * Enable moving the QSB on the 0th screen of the workspace. This is not a configuration feature
- * and should be modified at a project level.
- * @deprecated Use {@link BuildConfig#QSB_ON_FIRST_SCREEN} directly
- */
- @Deprecated
- public static final boolean QSB_ON_FIRST_SCREEN = BuildConfig.QSB_ON_FIRST_SCREEN;
-
/**
* Feature flag to handle define config changes dynamically instead of killing the process.
*
diff --git a/src/com/android/launcher3/graphics/LauncherPreviewRenderer.java b/src/com/android/launcher3/graphics/LauncherPreviewRenderer.java
index 4655783884..630c1fa14f 100644
--- a/src/com/android/launcher3/graphics/LauncherPreviewRenderer.java
+++ b/src/com/android/launcher3/graphics/LauncherPreviewRenderer.java
@@ -25,7 +25,6 @@ import static com.android.launcher3.Hotseat.ALPHA_CHANNEL_PREVIEW_RENDERER;
import static com.android.launcher3.LauncherPrefs.FIXED_LANDSCAPE_MODE;
import static com.android.launcher3.LauncherPrefs.GRID_NAME;
import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_HOTSEAT_PREDICTION;
-import static com.android.launcher3.Utilities.SHOULD_SHOW_FIRST_PAGE_WIDGET;
import static com.android.launcher3.graphics.ThemeManager.PREF_ICON_SHAPE;
import static com.android.launcher3.graphics.ThemeManager.THEMED_ICONS;
import static com.android.launcher3.model.ModelUtils.currentScreenContentFilter;
@@ -60,6 +59,7 @@ import androidx.annotation.Nullable;
import androidx.lifecycle.DefaultLifecycleObserver;
import androidx.lifecycle.LifecycleOwner;
+import com.android.launcher3.BuildConfig;
import com.android.launcher3.CellLayout;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Hotseat;
@@ -73,7 +73,6 @@ import com.android.launcher3.WorkspaceLayoutManager;
import com.android.launcher3.celllayout.CellLayoutLayoutParams;
import com.android.launcher3.celllayout.CellPosMapper;
import com.android.launcher3.concurrent.ExecutorsModule;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.dagger.ApiWrapperModule;
import com.android.launcher3.dagger.AppModule;
import com.android.launcher3.dagger.LauncherAppComponent;
@@ -463,7 +462,7 @@ public class LauncherPreviewRenderer extends BaseContext
// Add first page QSB
- if (FeatureFlags.QSB_ON_FIRST_SCREEN && !SHOULD_SHOW_FIRST_PAGE_WIDGET) {
+ if (BuildConfig.QSB_ON_FIRST_SCREEN) {
CellLayout firstScreen = mWorkspaceScreens.get(FIRST_SCREEN_ID);
View qsb = mHomeElementInflater.inflate(R.layout.qsb_preview, firstScreen, false);
// TODO: set bgHandler on qsb when it is BaseTemplateCard, which requires API changes.
diff --git a/src/com/android/launcher3/model/BaseLauncherBinder.java b/src/com/android/launcher3/model/BaseLauncherBinder.java
index dc4b6f02da..aa70f65ad2 100644
--- a/src/com/android/launcher3/model/BaseLauncherBinder.java
+++ b/src/com/android/launcher3/model/BaseLauncherBinder.java
@@ -154,16 +154,6 @@ public class BaseLauncherBinder {
executeCallbacksTask(c -> c.bindAllWidgets(widgets), mUiExecutor);
}
- /**
- * bindWidgets is abstract because it is a no-op for the go launcher.
- */
- public void bindSmartspaceWidget() {
- if (!WIDGETS_ENABLED) {
- return;
- }
- executeCallbacksTask(c -> c.bindSmartspaceWidget(), mUiExecutor);
- }
-
protected void executeCallbacksTask(CallbackTask task, Executor executor) {
executor.execute(() -> {
if (mMyBindingId != mBgDataModel.lastBindId) {
diff --git a/src/com/android/launcher3/model/BgDataModel.kt b/src/com/android/launcher3/model/BgDataModel.kt
index 719aa8d37e..f14c6c5eae 100644
--- a/src/com/android/launcher3/model/BgDataModel.kt
+++ b/src/com/android/launcher3/model/BgDataModel.kt
@@ -22,7 +22,6 @@ import android.content.pm.ShortcutInfo
import android.os.UserHandle
import android.util.Log
import androidx.annotation.AnyThread
-import androidx.core.util.size
import com.android.launcher3.BuildConfig
import com.android.launcher3.Flags
import com.android.launcher3.LauncherSettings.Favorites.CONTAINER_DESKTOP
@@ -30,7 +29,6 @@ import com.android.launcher3.LauncherSettings.Favorites.CONTAINER_HOTSEAT
import com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APP_PAIR
import com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT
import com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_FOLDER
-import com.android.launcher3.Utilities
import com.android.launcher3.Workspace
import com.android.launcher3.dagger.LauncherAppSingleton
import com.android.launcher3.logging.DumpManager
@@ -119,10 +117,7 @@ constructor(
val screenSet = IntSet()
itemsIdMap.forEach { if (it.container == CONTAINER_DESKTOP) screenSet.add(it.screenId) }
- if (
- (BuildConfig.QSB_ON_FIRST_SCREEN && !Utilities.SHOULD_SHOW_FIRST_PAGE_WIDGET) ||
- screenSet.isEmpty
- ) {
+ if (BuildConfig.QSB_ON_FIRST_SCREEN || screenSet.isEmpty) {
screenSet.add(Workspace.FIRST_SCREEN_ID)
}
return screenSet.array
@@ -404,8 +399,6 @@ constructor(
/** Binds the app widgets to the providers that share widgets with the UI. */
fun bindAllWidgets(widgets: List<@JvmSuppressWildcards WidgetsListBaseEntry>) {}
- fun bindSmartspaceWidget() {}
-
fun bindDeepShortcutMap(deepShortcutMap: HashMap) {}
/** Binds extra item provided any external source */
diff --git a/src/com/android/launcher3/model/DatabaseHelper.java b/src/com/android/launcher3/model/DatabaseHelper.java
index ed4f492a80..44470df831 100644
--- a/src/com/android/launcher3/model/DatabaseHelper.java
+++ b/src/com/android/launcher3/model/DatabaseHelper.java
@@ -16,7 +16,6 @@
package com.android.launcher3.model;
import static com.android.launcher3.LauncherSettings.Favorites.addTableToDb;
-import static com.android.launcher3.Utilities.SHOULD_SHOW_FIRST_PAGE_WIDGET;
import static com.android.launcher3.provider.LauncherDbUtils.dropTable;
import android.content.ContentValues;
@@ -37,10 +36,10 @@ import androidx.annotation.NonNull;
import com.android.launcher3.AutoInstallsLayout;
import com.android.launcher3.AutoInstallsLayout.LayoutParserCallback;
+import com.android.launcher3.BuildConfig;
import com.android.launcher3.LauncherSettings;
import com.android.launcher3.LauncherSettings.Favorites;
import com.android.launcher3.Utilities;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.logging.FileLog;
import com.android.launcher3.pm.UserCache;
import com.android.launcher3.provider.LauncherDbUtils;
@@ -257,8 +256,7 @@ public class DatabaseHelper extends NoLocaleSQLiteHelper implements
Favorites.SCREEN, IntArray.wrap(-777, -778)), null);
}
case 30: {
- if (FeatureFlags.QSB_ON_FIRST_SCREEN
- && !SHOULD_SHOW_FIRST_PAGE_WIDGET) {
+ if (BuildConfig.QSB_ON_FIRST_SCREEN) {
// Clean up first row in screen 0 as it might contain junk data.
Log.d(TAG, "Cleaning up first row");
db.delete(Favorites.TABLE_NAME,
diff --git a/src/com/android/launcher3/model/GridSizeMigrationDBController.java b/src/com/android/launcher3/model/GridSizeMigrationDBController.java
index 4867d33f88..3d56010a2d 100644
--- a/src/com/android/launcher3/model/GridSizeMigrationDBController.java
+++ b/src/com/android/launcher3/model/GridSizeMigrationDBController.java
@@ -16,12 +16,12 @@
package com.android.launcher3.model;
+import static com.android.launcher3.BuildConfig.QSB_ON_FIRST_SCREEN;
import static com.android.launcher3.GridType.GRID_TYPE_NON_ONE_GRID;
import static com.android.launcher3.GridType.GRID_TYPE_ONE_GRID;
import static com.android.launcher3.InvariantDeviceProfile.TYPE_TABLET;
import static com.android.launcher3.LauncherSettings.Favorites.TABLE_NAME;
import static com.android.launcher3.LauncherSettings.Favorites.TMP_TABLE;
-import static com.android.launcher3.Utilities.SHOULD_SHOW_FIRST_PAGE_WIDGET;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ROW_SHIFT_GRID_MIGRATION;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ROW_SHIFT_ONE_GRID_MIGRATION;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_STANDARD_GRID_MIGRATION;
@@ -47,7 +47,6 @@ import com.android.launcher3.Flags;
import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.LauncherSettings;
import com.android.launcher3.Utilities;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.logging.StatsLogManager;
import com.android.launcher3.provider.LauncherDbUtils.SQLiteTransaction;
import com.android.launcher3.util.GridOccupancy;
@@ -398,10 +397,8 @@ public class GridSizeMigrationDBController {
@NonNull final List sortedItemsToPlace, List idsInUse) {
final GridOccupancy occupied = new GridOccupancy(trgX, trgY);
final Point trg = new Point(trgX, trgY);
- final Point next = new Point(0, screenId == 0
- && (FeatureFlags.QSB_ON_FIRST_SCREEN
- && !SHOULD_SHOW_FIRST_PAGE_WIDGET)
- ? 1 /* smartspace */ : 0);
+ final Point next = new Point(0,
+ screenId == 0 && QSB_ON_FIRST_SCREEN ? 1 /* smartspace */ : 0);
List existedEntries = destReader.mWorkspaceEntriesByScreenId.get(screenId);
if (existedEntries != null) {
for (DbEntry entry : existedEntries) {
diff --git a/src/com/android/launcher3/model/GridSizeMigrationLogic.kt b/src/com/android/launcher3/model/GridSizeMigrationLogic.kt
index e8799b034d..8c0a90733f 100644
--- a/src/com/android/launcher3/model/GridSizeMigrationLogic.kt
+++ b/src/com/android/launcher3/model/GridSizeMigrationLogic.kt
@@ -20,14 +20,13 @@ import android.database.sqlite.SQLiteDatabase
import android.graphics.Point
import android.util.Log
import androidx.annotation.VisibleForTesting
+import com.android.launcher3.BuildConfig
import com.android.launcher3.Flags
import com.android.launcher3.LauncherPrefs
import com.android.launcher3.LauncherPrefs.Companion.get
import com.android.launcher3.LauncherSettings
import com.android.launcher3.LauncherSettings.Favorites.TABLE_NAME
import com.android.launcher3.LauncherSettings.Favorites.TMP_TABLE
-import com.android.launcher3.Utilities
-import com.android.launcher3.config.FeatureFlags
import com.android.launcher3.logging.FileLog
import com.android.launcher3.logging.StatsLogManager
import com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ROW_SHIFT_GRID_MIGRATION
@@ -502,10 +501,7 @@ class GridSizeMigrationLogic {
val occupied = GridOccupancy(trgX, trgY)
val trg = Point(trgX, trgY)
val next: Point =
- if (
- screenId == 0 &&
- (FeatureFlags.QSB_ON_FIRST_SCREEN && !Utilities.SHOULD_SHOW_FIRST_PAGE_WIDGET)
- ) {
+ if (screenId == 0 && BuildConfig.QSB_ON_FIRST_SCREEN) {
Point(0, 1 /* smartspace */)
} else {
Point(0, 0)
diff --git a/src/com/android/launcher3/model/LoaderCursor.java b/src/com/android/launcher3/model/LoaderCursor.java
index 1e6d44986b..392383839a 100644
--- a/src/com/android/launcher3/model/LoaderCursor.java
+++ b/src/com/android/launcher3/model/LoaderCursor.java
@@ -22,7 +22,6 @@ import static com.android.launcher3.LauncherSettings.Favorites.DESKTOP_ICON_FLAG
import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APPLICATION;
import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APP_PAIR;
import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT;
-import static com.android.launcher3.Utilities.SHOULD_SHOW_FIRST_PAGE_WIDGET;
import static com.android.launcher3.icons.cache.CacheLookupFlag.DEFAULT_LOOKUP_FLAG;
import static com.android.launcher3.model.data.ItemInfoWithIcon.FLAG_ARCHIVED;
@@ -43,6 +42,7 @@ import android.util.LongSparseArray;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
+import com.android.launcher3.BuildConfig;
import com.android.launcher3.Flags;
import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.LauncherModel;
@@ -52,7 +52,6 @@ import com.android.launcher3.Utilities;
import com.android.launcher3.Workspace;
import com.android.launcher3.backuprestore.LauncherRestoreEventLogger;
import com.android.launcher3.backuprestore.LauncherRestoreEventLogger.RestoreError;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.dagger.ApplicationContext;
import com.android.launcher3.icons.IconCache;
import com.android.launcher3.logging.FileLog;
@@ -635,8 +634,7 @@ public class LoaderCursor extends CursorWrapper {
if (!mOccupied.containsKey(item.screenId)) {
GridOccupancy screen = new GridOccupancy(countX + 1, countY + 1);
- if (item.screenId == Workspace.FIRST_SCREEN_ID && (FeatureFlags.QSB_ON_FIRST_SCREEN
- && !SHOULD_SHOW_FIRST_PAGE_WIDGET)) {
+ if (item.screenId == Workspace.FIRST_SCREEN_ID && BuildConfig.QSB_ON_FIRST_SCREEN) {
// Mark the first X columns (X is width of the search container) in the first row as
// occupied (if the feature is enabled) in order to account for the search
// container.
diff --git a/src/com/android/launcher3/model/LoaderTask.java b/src/com/android/launcher3/model/LoaderTask.java
index d01d53e1d5..3ed72d8789 100644
--- a/src/com/android/launcher3/model/LoaderTask.java
+++ b/src/com/android/launcher3/model/LoaderTask.java
@@ -16,11 +16,8 @@
package com.android.launcher3.model;
-import static com.android.launcher3.BuildConfig.WIDGET_ON_FIRST_SCREEN;
import static com.android.launcher3.Flags.enableLauncherBrMetricsFixed;
-import static com.android.launcher3.Flags.enableSmartspaceAsAWidget;
import static com.android.launcher3.LauncherPrefs.IS_FIRST_LOAD_AFTER_RESTORE;
-import static com.android.launcher3.LauncherPrefs.SHOULD_SHOW_SMARTSPACE;
import static com.android.launcher3.LauncherSettings.Favorites.DESKTOP_ICON_FLAG;
import static com.android.launcher3.icons.CacheableShortcutInfo.convertShortcutsToCacheableShortcuts;
import static com.android.launcher3.icons.cache.CacheLookupFlag.DEFAULT_LOOKUP_FLAG;
@@ -370,19 +367,6 @@ public class LoaderTask implements Runnable {
mLauncherBinder.bindWidgets();
logASplit("bindWidgets finished");
verifyNotStopped();
- LauncherPrefs prefs = LauncherPrefs.get(mContext);
-
- if (enableSmartspaceAsAWidget() && prefs.get(SHOULD_SHOW_SMARTSPACE)) {
- mLauncherBinder.bindSmartspaceWidget();
- // Turn off pref.
- prefs.putSync(SHOULD_SHOW_SMARTSPACE.to(false));
- logASplit("bindSmartspaceWidget finished");
- verifyNotStopped();
- } else if (!enableSmartspaceAsAWidget() && WIDGET_ON_FIRST_SCREEN
- && !prefs.get(LauncherPrefs.SHOULD_SHOW_SMARTSPACE)) {
- // Turn on pref.
- prefs.putSync(SHOULD_SHOW_SMARTSPACE.to(true));
- }
logASplit("saving all widgets in icon cache");
updateHandler.updateIcons(allWidgetsList,
diff --git a/src/com/android/launcher3/model/WorkspaceItemSpaceFinder.java b/src/com/android/launcher3/model/WorkspaceItemSpaceFinder.java
index 17f1615d8d..ae481736fd 100644
--- a/src/com/android/launcher3/model/WorkspaceItemSpaceFinder.java
+++ b/src/com/android/launcher3/model/WorkspaceItemSpaceFinder.java
@@ -15,15 +15,14 @@
*/
package com.android.launcher3.model;
-import static com.android.launcher3.Utilities.SHOULD_SHOW_FIRST_PAGE_WIDGET;
import static com.android.launcher3.WorkspaceLayoutManager.FIRST_SCREEN_ID;
import android.util.LongSparseArray;
+import com.android.launcher3.BuildConfig;
import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.LauncherModel;
import com.android.launcher3.LauncherSettings;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.util.GridOccupancy;
import com.android.launcher3.util.IntArray;
@@ -81,8 +80,7 @@ public class WorkspaceItemSpaceFinder {
int screenCount = workspaceScreens.size();
// First check the preferred screen.
IntSet screensToExclude = new IntSet();
- if (FeatureFlags.QSB_ON_FIRST_SCREEN
- && !SHOULD_SHOW_FIRST_PAGE_WIDGET) {
+ if (BuildConfig.QSB_ON_FIRST_SCREEN) {
screensToExclude.add(FIRST_SCREEN_ID);
}
diff --git a/src/com/android/launcher3/qsb/QsbContainerView.java b/src/com/android/launcher3/qsb/QsbContainerView.java
index d6b41b06a3..a787fb4363 100644
--- a/src/com/android/launcher3/qsb/QsbContainerView.java
+++ b/src/com/android/launcher3/qsb/QsbContainerView.java
@@ -20,8 +20,6 @@ import static android.appwidget.AppWidgetManager.ACTION_APPWIDGET_BIND;
import static android.appwidget.AppWidgetManager.EXTRA_APPWIDGET_ID;
import static android.appwidget.AppWidgetManager.EXTRA_APPWIDGET_PROVIDER;
-import static com.android.launcher3.Utilities.SHOULD_SHOW_FIRST_PAGE_WIDGET;
-
import android.app.Activity;
import android.app.Fragment;
import android.app.SearchManager;
@@ -44,11 +42,11 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.WorkerThread;
+import com.android.launcher3.BuildConfig;
import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.LauncherPrefs;
import com.android.launcher3.R;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.graphics.FragmentWithPreview;
import com.android.launcher3.widget.util.WidgetSizes;
@@ -292,8 +290,7 @@ public class QsbContainerView extends FrameLayout {
}
public boolean isQsbEnabled() {
- return FeatureFlags.QSB_ON_FIRST_SCREEN
- && !SHOULD_SHOW_FIRST_PAGE_WIDGET;
+ return BuildConfig.QSB_ON_FIRST_SCREEN;
}
protected Bundle createBindOptions() {
diff --git a/src/com/android/launcher3/widget/custom/CustomWidgetManager.java b/src/com/android/launcher3/widget/custom/CustomWidgetManager.java
index 20cce8fc2d..f153570d9b 100644
--- a/src/com/android/launcher3/widget/custom/CustomWidgetManager.java
+++ b/src/com/android/launcher3/widget/custom/CustomWidgetManager.java
@@ -16,7 +16,6 @@
package com.android.launcher3.widget.custom;
-import static com.android.launcher3.Flags.enableSmartspaceAsAWidget;
import static com.android.launcher3.model.data.LauncherAppWidgetInfo.CUSTOM_WIDGET_ID;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.launcher3.widget.LauncherAppWidgetProviderInfo.CLS_CUSTOM_WIDGET_PREFIX;
@@ -27,13 +26,11 @@ import android.content.ComponentName;
import android.content.Context;
import android.os.Parcel;
import android.os.Process;
-import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
-import com.android.launcher3.R;
import com.android.launcher3.dagger.ApplicationContext;
import com.android.launcher3.dagger.LauncherAppSingleton;
import com.android.launcher3.dagger.LauncherBaseAppComponent;
@@ -46,7 +43,6 @@ import com.android.launcher3.widget.LauncherAppWidgetProviderInfo;
import com.android.systemui.plugins.CustomWidgetPlugin;
import com.android.systemui.plugins.PluginListener;
-import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -90,22 +86,6 @@ public class CustomWidgetManager implements PluginListener {
mCustomWidgets = new ArrayList<>();
pluginManager.addPluginListener(this, CustomWidgetPlugin.class, true);
- if (enableSmartspaceAsAWidget()) {
- for (String s: context.getResources()
- .getStringArray(R.array.custom_widget_providers)) {
- try {
- Class> cls = Class.forName(s);
- CustomWidgetPlugin plugin = (CustomWidgetPlugin)
- cls.getDeclaredConstructor(Context.class).newInstance(context);
- MAIN_EXECUTOR.execute(() -> onPluginConnected(plugin, context));
- } catch (ClassNotFoundException | InstantiationException
- | IllegalAccessException
- | ClassCastException | NoSuchMethodException
- | InvocationTargetException e) {
- Log.e(TAG, "Exception found when trying to add custom widgets: " + e);
- }
- }
- }
tracker.addCloseable(() -> pluginManager.removePluginListener(this));
}
diff --git a/src_build_config/com/android/launcher3/BuildConfig.java b/src_build_config/com/android/launcher3/BuildConfig.java
index 6d4f56d655..3d39c37b6e 100644
--- a/src_build_config/com/android/launcher3/BuildConfig.java
+++ b/src_build_config/com/android/launcher3/BuildConfig.java
@@ -26,11 +26,6 @@ public final class BuildConfig {
*/
public static final boolean QSB_ON_FIRST_SCREEN = true;
- /**
- * Flag to state if the widget on the top of the first screen should be shown.
- */
- public static final boolean WIDGET_ON_FIRST_SCREEN = false;
-
/**
* Flag to control various developer centric features
*/
diff --git a/tests/Android.bp b/tests/Android.bp
index fc08e86284..e2698dab21 100644
--- a/tests/Android.bp
+++ b/tests/Android.bp
@@ -57,13 +57,7 @@ filegroup {
name: "launcher-oop-tests-src",
srcs: [
":launcher-testing-helpers",
- "src/com/android/launcher3/allapps/TaplOpenCloseAllAppsTest.java",
- "src/com/android/launcher3/allapps/TaplAllAppsIconsWorkingTest.java",
- "src/com/android/launcher3/appiconmenu/TaplAppIconMenuTest.java",
- "src/com/android/launcher3/dragging/TaplDragTest.java",
- "src/com/android/launcher3/dragging/TaplUninstallRemoveTest.java",
- "src/com/android/launcher3/ui/TaplTestsLauncher3Test.java",
- "src/com/android/launcher3/ui/workspace/TaplWorkspaceTest.java",
+ ":launcher-oop-tests-only",
],
}
@@ -158,8 +152,8 @@ filegroup {
"src/**/*.kt",
"multivalentTests/src/**/*.java",
"multivalentTests/src/**/*.kt",
- "src/com/android/launcher3/ui/AbstractLauncherUiTest.java",
- "src/com/android/launcher3/ui/BaseLauncherTaplTest.java",
+ "src/com/android/launcher3/util/ui/AbstractLauncherUiTest.java",
+ "src/com/android/launcher3/util/ui/BaseLauncherTaplTest.java",
"tapl/com/android/launcher3/tapl/*.java",
"tapl/com/android/launcher3/tapl/*.kt",
],
diff --git a/tests/multivalentTests/src/com/android/launcher3/Android.bp b/tests/multivalentTests/src/com/android/launcher3/Android.bp
new file mode 100644
index 0000000000..189ec96bb8
--- /dev/null
+++ b/tests/multivalentTests/src/com/android/launcher3/Android.bp
@@ -0,0 +1,15 @@
+filegroup {
+ name: "launcher-shared-tests-utils",
+ srcs: [
+ "testcomponent/AppWidgetDynamicColors.java",
+ "testcomponent/AppWidgetHidden.java",
+ "testcomponent/AppWidgetNoConfig.java",
+ "testcomponent/AppWidgetWithConfig.java",
+ "testcomponent/TouchEventGenerator.java",
+ "util/ModelTestExtensions.kt",
+ "util/rule/TestStabilityRule.java",
+ "util/TestUtil.java",
+ "util/ui/TestViewHelpers.java",
+ "util/workspace/FavoriteItemsTransaction.java",
+ ],
+}
diff --git a/tests/multivalentTests/src/com/android/launcher3/celllayout/board/TestWorkspaceBuilder.kt b/tests/multivalentTests/src/com/android/launcher3/celllayout/board/TestWorkspaceBuilder.kt
index 3405cae355..f58fd468eb 100644
--- a/tests/multivalentTests/src/com/android/launcher3/celllayout/board/TestWorkspaceBuilder.kt
+++ b/tests/multivalentTests/src/com/android/launcher3/celllayout/board/TestWorkspaceBuilder.kt
@@ -25,13 +25,13 @@ import androidx.test.core.app.ApplicationProvider
import androidx.test.platform.app.InstrumentationRegistry
import com.android.launcher3.InvariantDeviceProfile
import com.android.launcher3.LauncherSettings
-import com.android.launcher3.celllayout.FavoriteItemsTransaction
import com.android.launcher3.model.data.AppInfo
import com.android.launcher3.model.data.FolderInfo
import com.android.launcher3.model.data.ItemInfo
import com.android.launcher3.model.data.WorkspaceItemInfo
-import com.android.launcher3.ui.TestViewHelpers
import com.android.launcher3.util.WidgetUtils
+import com.android.launcher3.util.ui.TestViewHelpers
+import com.android.launcher3.util.workspace.FavoriteItemsTransaction
import java.util.function.Supplier
class TestWorkspaceBuilder(private val mContext: Context) {
diff --git a/tests/multivalentTests/src/com/android/launcher3/ui/TestViewHelpers.java b/tests/multivalentTests/src/com/android/launcher3/util/ui/TestViewHelpers.java
similarity index 98%
rename from tests/multivalentTests/src/com/android/launcher3/ui/TestViewHelpers.java
rename to tests/multivalentTests/src/com/android/launcher3/util/ui/TestViewHelpers.java
index 4b2bade452..c7c2cd7ef0 100644
--- a/tests/multivalentTests/src/com/android/launcher3/ui/TestViewHelpers.java
+++ b/tests/multivalentTests/src/com/android/launcher3/util/ui/TestViewHelpers.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-package com.android.launcher3.ui;
+package com.android.launcher3.util.ui;
import static android.os.Process.myUserHandle;
diff --git a/tests/multivalentTests/src/com/android/launcher3/celllayout/FavoriteItemsTransaction.java b/tests/multivalentTests/src/com/android/launcher3/util/workspace/FavoriteItemsTransaction.java
similarity index 98%
rename from tests/multivalentTests/src/com/android/launcher3/celllayout/FavoriteItemsTransaction.java
rename to tests/multivalentTests/src/com/android/launcher3/util/workspace/FavoriteItemsTransaction.java
index f7723392d4..c4e0624e3a 100644
--- a/tests/multivalentTests/src/com/android/launcher3/celllayout/FavoriteItemsTransaction.java
+++ b/tests/multivalentTests/src/com/android/launcher3/util/workspace/FavoriteItemsTransaction.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.launcher3.celllayout;
+package com.android.launcher3.util.workspace;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;
diff --git a/tests/src/com/android/launcher3/Android.bp b/tests/src/com/android/launcher3/Android.bp
new file mode 100644
index 0000000000..f40c027ba4
--- /dev/null
+++ b/tests/src/com/android/launcher3/Android.bp
@@ -0,0 +1,59 @@
+// Should only contain test files, no utility classes
+filegroup {
+ name: "launcher-e2e-tests-only",
+ srcs: [
+ "allapps/TaplAllAppsIconsWorkingTest.java",
+ "allapps/TaplOpenCloseAllAppsTest.java",
+ "appiconmenu/TaplAppIconMenuTest.java",
+ "dragging/TaplDragTest.java",
+ "dragging/TaplUninstallRemoveTest.java",
+ "tapl/TaplUtilityTest.java",
+ "widget/TaplAddWidgetTest.java",
+ "ui/TaplTestsLauncher3Test.java",
+ "workspace/TaplTwoPanelWorkspaceTest.java",
+ "workspace/TaplWorkspaceTest.java",
+ ],
+}
+
+filegroup {
+ name: "launcher-e2e-tests-utils",
+ srcs: [
+ "testcomponent/TestCommandReceiver.java",
+ "util/TestConstants.java",
+ "util/Wait.kt",
+ "util/rule/FailureWatcher.java",
+ "util/rule/MutualExclusionRule.java",
+ "util/rule/SamplerRule.java",
+ "util/rule/ScreenRecordRule.java",
+ "util/rule/ShellCommandRule.java",
+ "util/rule/ViewCaptureRule.kt",
+ "util/rule/TestIsolationRule.java",
+ "util/ui/AbstractLauncherUiTest.java",
+ "util/ui/BaseLauncherTaplTest.java",
+ "util/ui/PortraitLandscapeRunner.java",
+ ],
+}
+
+// Combination of tests and utils in the launcher3 package
+filegroup {
+ name: "launcher-e2e-tests",
+ srcs: [
+ ":launcher-e2e-tests-only",
+ ":launcher-e2e-tests-utils",
+ ":launcher-viewcapture-analysis",
+ ],
+}
+
+// TODO(b/324261526) After the bug is completed this file group should not exists anymore
+filegroup {
+ name: "launcher-oop-tests-only",
+ srcs: [
+ "allapps/TaplAllAppsIconsWorkingTest.java",
+ "allapps/TaplOpenCloseAllAppsTest.java",
+ "appiconmenu/TaplAppIconMenuTest.java",
+ "dragging/TaplDragTest.java",
+ "dragging/TaplUninstallRemoveTest.java",
+ "ui/TaplTestsLauncher3Test.java",
+ "workspace/TaplWorkspaceTest.java",
+ ],
+}
diff --git a/tests/src/com/android/launcher3/allapps/TaplAllAppsIconsWorkingTest.java b/tests/src/com/android/launcher3/allapps/TaplAllAppsIconsWorkingTest.java
index 1b2b8dcc9d..6be4850c46 100644
--- a/tests/src/com/android/launcher3/allapps/TaplAllAppsIconsWorkingTest.java
+++ b/tests/src/com/android/launcher3/allapps/TaplAllAppsIconsWorkingTest.java
@@ -24,8 +24,8 @@ import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
import com.android.launcher3.tapl.AppIcon;
import com.android.launcher3.tapl.HomeAllApps;
-import com.android.launcher3.ui.AbstractLauncherUiTest;
-import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape;
+import com.android.launcher3.util.ui.AbstractLauncherUiTest;
+import com.android.launcher3.util.ui.PortraitLandscapeRunner.PortraitLandscape;
import org.junit.Test;
diff --git a/tests/src/com/android/launcher3/allapps/TaplOpenCloseAllAppsTest.java b/tests/src/com/android/launcher3/allapps/TaplOpenCloseAllAppsTest.java
index 5274631845..4bc7138e28 100644
--- a/tests/src/com/android/launcher3/allapps/TaplOpenCloseAllAppsTest.java
+++ b/tests/src/com/android/launcher3/allapps/TaplOpenCloseAllAppsTest.java
@@ -31,8 +31,8 @@ import androidx.test.platform.app.InstrumentationRegistry;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
import com.android.launcher3.tapl.AllApps;
-import com.android.launcher3.ui.AbstractLauncherUiTest;
-import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape;
+import com.android.launcher3.util.ui.AbstractLauncherUiTest;
+import com.android.launcher3.util.ui.PortraitLandscapeRunner.PortraitLandscape;
import org.junit.Test;
diff --git a/tests/src/com/android/launcher3/ui/WorkProfileTest.java b/tests/src/com/android/launcher3/allapps/WorkProfileTest.java
similarity index 96%
rename from tests/src/com/android/launcher3/ui/WorkProfileTest.java
rename to tests/src/com/android/launcher3/allapps/WorkProfileTest.java
index c191760f5d..b625e6d2cb 100644
--- a/tests/src/com/android/launcher3/ui/WorkProfileTest.java
+++ b/tests/src/com/android/launcher3/allapps/WorkProfileTest.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.launcher3.ui;
+package com.android.launcher3.allapps;
import static com.android.launcher3.LauncherPrefs.WORK_EDU_STEP;
import static com.android.launcher3.LauncherState.ALL_APPS;
@@ -37,11 +37,6 @@ import androidx.test.filters.LargeTest;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherPrefs;
import com.android.launcher3.R;
-import com.android.launcher3.allapps.ActivityAllAppsContainerView;
-import com.android.launcher3.allapps.AllAppsPagedView;
-import com.android.launcher3.allapps.WorkEduCard;
-import com.android.launcher3.allapps.WorkPausedCard;
-import com.android.launcher3.allapps.WorkProfileManager;
import com.android.launcher3.util.BaseLauncherActivityTest;
import com.android.launcher3.util.TestUtil;
import com.android.launcher3.util.rule.ScreenRecordRule;
diff --git a/tests/src/com/android/launcher3/appiconmenu/TaplAppIconMenuTest.java b/tests/src/com/android/launcher3/appiconmenu/TaplAppIconMenuTest.java
index bd573820dc..3a7232ca9d 100644
--- a/tests/src/com/android/launcher3/appiconmenu/TaplAppIconMenuTest.java
+++ b/tests/src/com/android/launcher3/appiconmenu/TaplAppIconMenuTest.java
@@ -29,8 +29,8 @@ import com.android.launcher3.tapl.AllApps;
import com.android.launcher3.tapl.AppIconMenu;
import com.android.launcher3.tapl.AppIconMenuItem;
import com.android.launcher3.tapl.HomeAllApps;
-import com.android.launcher3.ui.AbstractLauncherUiTest;
-import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape;
+import com.android.launcher3.util.ui.AbstractLauncherUiTest;
+import com.android.launcher3.util.ui.PortraitLandscapeRunner.PortraitLandscape;
import org.junit.Test;
diff --git a/tests/src/com/android/launcher3/dragging/TaplDragTest.java b/tests/src/com/android/launcher3/dragging/TaplDragTest.java
index bf47026760..d7ce08acd4 100644
--- a/tests/src/com/android/launcher3/dragging/TaplDragTest.java
+++ b/tests/src/com/android/launcher3/dragging/TaplDragTest.java
@@ -38,10 +38,10 @@ import com.android.launcher3.tapl.HomeAllApps;
import com.android.launcher3.tapl.HomeAppIcon;
import com.android.launcher3.tapl.HomeAppIconMenuItem;
import com.android.launcher3.tapl.Workspace;
-import com.android.launcher3.ui.AbstractLauncherUiTest;
-import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape;
import com.android.launcher3.util.TestUtil;
import com.android.launcher3.util.rule.ScreenRecordRule;
+import com.android.launcher3.util.ui.AbstractLauncherUiTest;
+import com.android.launcher3.util.ui.PortraitLandscapeRunner.PortraitLandscape;
import org.junit.Test;
diff --git a/tests/src/com/android/launcher3/dragging/TaplUninstallRemoveTest.java b/tests/src/com/android/launcher3/dragging/TaplUninstallRemoveTest.java
index 459db73650..7443a9a46e 100644
--- a/tests/src/com/android/launcher3/dragging/TaplUninstallRemoveTest.java
+++ b/tests/src/com/android/launcher3/dragging/TaplUninstallRemoveTest.java
@@ -34,10 +34,10 @@ import com.android.launcher3.Launcher;
import com.android.launcher3.tapl.HomeAllApps;
import com.android.launcher3.tapl.HomeAppIcon;
import com.android.launcher3.tapl.Workspace;
-import com.android.launcher3.ui.AbstractLauncherUiTest;
-import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape;
import com.android.launcher3.util.TestUtil;
import com.android.launcher3.util.Wait;
+import com.android.launcher3.util.ui.AbstractLauncherUiTest;
+import com.android.launcher3.util.ui.PortraitLandscapeRunner.PortraitLandscape;
import org.junit.Test;
diff --git a/tests/src/com/android/launcher3/integration/celllayout/IntegrationReorderWidgetsTest.kt b/tests/src/com/android/launcher3/integration/celllayout/IntegrationReorderWidgetsTest.kt
index b5f4fa26a8..813225ccad 100644
--- a/tests/src/com/android/launcher3/integration/celllayout/IntegrationReorderWidgetsTest.kt
+++ b/tests/src/com/android/launcher3/integration/celllayout/IntegrationReorderWidgetsTest.kt
@@ -33,7 +33,6 @@ import com.android.launcher3.celllayout.CellLayoutTestCaseReader
import com.android.launcher3.celllayout.CellLayoutTestCaseReader.Board
import com.android.launcher3.celllayout.CellLayoutTestCaseReader.TestSection
import com.android.launcher3.celllayout.CellLayoutTestUtils
-import com.android.launcher3.celllayout.FavoriteItemsTransaction
import com.android.launcher3.celllayout.ReorderTestCase
import com.android.launcher3.celllayout.board.CellLayoutBoard
import com.android.launcher3.celllayout.board.TestWorkspaceBuilder
@@ -53,6 +52,7 @@ import com.android.launcher3.util.ModelTestExtensions.clearModelDb
import com.android.launcher3.util.rule.ScreenRecordRule
import com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord
import com.android.launcher3.util.rule.ShellCommandRule
+import com.android.launcher3.util.workspace.FavoriteItemsTransaction
import com.android.launcher3.widget.LauncherAppWidgetHostView
import kotlin.math.abs
import kotlin.math.roundToInt
diff --git a/tests/src/com/android/launcher3/ui/DoubleShadowIconDrawableTest.kt b/tests/src/com/android/launcher3/model/DoubleShadowIconDrawableTest.kt
similarity index 97%
rename from tests/src/com/android/launcher3/ui/DoubleShadowIconDrawableTest.kt
rename to tests/src/com/android/launcher3/model/DoubleShadowIconDrawableTest.kt
index 1cee71c219..45fef14a9c 100644
--- a/tests/src/com/android/launcher3/ui/DoubleShadowIconDrawableTest.kt
+++ b/tests/src/com/android/launcher3/model/DoubleShadowIconDrawableTest.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher3.ui
+package com.android.launcher3.model
import android.graphics.Color
import android.graphics.drawable.Drawable
@@ -58,7 +58,7 @@ class DoubleShadowIconDrawableTest {
keyShadowBlur = 3f,
keyShadowOffsetX = 4f,
keyShadowOffsetY = 5f,
- keyShadowColor = 6
+ keyShadowColor = 6,
)
val originalDrawable: Drawable = mock()
val iconSize = 2
@@ -73,14 +73,14 @@ class DoubleShadowIconDrawableTest {
shadowInfo.ambientShadowBlur,
0f,
0f,
- Color.alpha(shadowInfo.ambientShadowColor).toFloat()
+ Color.alpha(shadowInfo.ambientShadowColor).toFloat(),
)
verify(shadowDrawableUnderTest)
.createShadowRenderEffect(
shadowInfo.keyShadowBlur,
shadowInfo.keyShadowOffsetX,
shadowInfo.keyShadowOffsetY,
- Color.alpha(shadowInfo.keyShadowColor).toFloat()
+ Color.alpha(shadowInfo.keyShadowColor).toFloat(),
)
}
}
diff --git a/tests/src/com/android/launcher3/model/LoaderTaskTest.kt b/tests/src/com/android/launcher3/model/LoaderTaskTest.kt
index 8002305fd2..6ecb86e1d1 100644
--- a/tests/src/com/android/launcher3/model/LoaderTaskTest.kt
+++ b/tests/src/com/android/launcher3/model/LoaderTaskTest.kt
@@ -39,7 +39,6 @@ import com.android.launcher3.model.data.IconRequestInfo
import com.android.launcher3.model.data.WorkspaceItemInfo
import com.android.launcher3.pm.UserCache
import com.android.launcher3.provider.RestoreDbTask
-import com.android.launcher3.ui.TestViewHelpers
import com.android.launcher3.util.AllModulesForTest
import com.android.launcher3.util.Executors.MODEL_EXECUTOR
import com.android.launcher3.util.LooperIdleLock
@@ -47,6 +46,7 @@ import com.android.launcher3.util.ModelTestExtensions
import com.android.launcher3.util.SandboxApplication
import com.android.launcher3.util.TestUtil
import com.android.launcher3.util.UserIconInfo
+import com.android.launcher3.util.ui.TestViewHelpers
import com.google.common.truth.Truth.assertThat
import dagger.BindsInstance
import dagger.Component
diff --git a/tests/src/com/android/launcher3/ui/ShadowInfoTest.kt b/tests/src/com/android/launcher3/model/ShadowInfoTest.kt
similarity index 97%
rename from tests/src/com/android/launcher3/ui/ShadowInfoTest.kt
rename to tests/src/com/android/launcher3/model/ShadowInfoTest.kt
index ef4dc1a8e7..faa0427295 100644
--- a/tests/src/com/android/launcher3/ui/ShadowInfoTest.kt
+++ b/tests/src/com/android/launcher3/model/ShadowInfoTest.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher3.ui
+package com.android.launcher3.model
import android.content.Context
import android.content.res.TypedArray
@@ -47,7 +47,7 @@ class ShadowInfoTest {
keyShadowBlur = 3f,
keyShadowOffsetX = 4f,
keyShadowOffsetY = 5f,
- keyShadowColor = 6
+ keyShadowColor = 6,
)
doReturn(styledAttrs)
.whenever(mockContext)
diff --git a/tests/src/com/android/launcher3/ui/TaplTestsLauncher3Test.java b/tests/src/com/android/launcher3/ui/TaplTestsLauncher3Test.java
index 46a79526ff..699224e887 100644
--- a/tests/src/com/android/launcher3/ui/TaplTestsLauncher3Test.java
+++ b/tests/src/com/android/launcher3/ui/TaplTestsLauncher3Test.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2019 The Android Open Source Project
+ * Copyright (C) 2025 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,10 +24,12 @@ import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
import com.android.launcher3.Launcher;
+import com.android.launcher3.util.ui.AbstractLauncherUiTest;
import org.junit.Test;
import org.junit.runner.RunWith;
+// TODO(415813575) - Remove this test.
@LargeTest
@RunWith(AndroidJUnit4.class)
public class TaplTestsLauncher3Test extends AbstractLauncherUiTest {
diff --git a/tests/src/com/android/launcher3/util/ItemInflaterTest.kt b/tests/src/com/android/launcher3/util/ItemInflaterTest.kt
index a1dfc538dc..4f01a21573 100644
--- a/tests/src/com/android/launcher3/util/ItemInflaterTest.kt
+++ b/tests/src/com/android/launcher3/util/ItemInflaterTest.kt
@@ -42,10 +42,10 @@ import com.android.launcher3.model.data.LauncherAppWidgetInfo
import com.android.launcher3.model.data.LauncherAppWidgetInfo.FLAG_ID_NOT_VALID
import com.android.launcher3.model.data.LauncherAppWidgetInfo.FLAG_UI_NOT_READY
import com.android.launcher3.model.data.LauncherAppWidgetInfo.RESTORE_COMPLETED
-import com.android.launcher3.ui.TestViewHelpers
import com.android.launcher3.util.Executors.MAIN_EXECUTOR
import com.android.launcher3.util.Executors.VIEW_PREINFLATION_EXECUTOR
import com.android.launcher3.util.rule.ShellCommandRule
+import com.android.launcher3.util.ui.TestViewHelpers
import com.android.launcher3.widget.LauncherAppWidgetHostView
import com.android.launcher3.widget.LauncherWidgetHolder
import com.android.launcher3.widget.PendingAppWidgetHostView
diff --git a/tests/src/com/android/launcher3/util/rule/FailureWatcher.java b/tests/src/com/android/launcher3/util/rule/FailureWatcher.java
index 3b8530984c..32d8a0def5 100644
--- a/tests/src/com/android/launcher3/util/rule/FailureWatcher.java
+++ b/tests/src/com/android/launcher3/util/rule/FailureWatcher.java
@@ -12,7 +12,7 @@ import androidx.test.uiautomator.UiDevice;
import com.android.app.viewcapture.data.ExportedData;
import com.android.launcher3.tapl.LauncherInstrumentation;
-import com.android.launcher3.ui.BaseLauncherTaplTest;
+import com.android.launcher3.util.ui.BaseLauncherTaplTest;
import org.junit.rules.TestWatcher;
import org.junit.runner.Description;
diff --git a/tests/src/com/android/launcher3/util/rule/TestIsolationRule.java b/tests/src/com/android/launcher3/util/rule/TestIsolationRule.java
index 2b45902813..9b8ee29caf 100644
--- a/tests/src/com/android/launcher3/util/rule/TestIsolationRule.java
+++ b/tests/src/com/android/launcher3/util/rule/TestIsolationRule.java
@@ -20,7 +20,7 @@ import androidx.test.InstrumentationRegistry;
import androidx.test.uiautomator.UiDevice;
import com.android.launcher3.tapl.LauncherInstrumentation;
-import com.android.launcher3.ui.AbstractLauncherUiTest;
+import com.android.launcher3.util.ui.AbstractLauncherUiTest;
import org.junit.rules.TestRule;
import org.junit.runner.Description;
diff --git a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java b/tests/src/com/android/launcher3/util/ui/AbstractLauncherUiTest.java
similarity index 99%
rename from tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
rename to tests/src/com/android/launcher3/util/ui/AbstractLauncherUiTest.java
index 6e46fe583a..7a8d6e788e 100644
--- a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
+++ b/tests/src/com/android/launcher3/util/ui/AbstractLauncherUiTest.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-package com.android.launcher3.ui;
+package com.android.launcher3.util.ui;
import static androidx.test.InstrumentationRegistry.getInstrumentation;
diff --git a/tests/src/com/android/launcher3/ui/BaseLauncherTaplTest.java b/tests/src/com/android/launcher3/util/ui/BaseLauncherTaplTest.java
similarity index 99%
rename from tests/src/com/android/launcher3/ui/BaseLauncherTaplTest.java
rename to tests/src/com/android/launcher3/util/ui/BaseLauncherTaplTest.java
index 59800ecf6f..b743f575fb 100644
--- a/tests/src/com/android/launcher3/ui/BaseLauncherTaplTest.java
+++ b/tests/src/com/android/launcher3/util/ui/BaseLauncherTaplTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher3.ui;
+package com.android.launcher3.util.ui;
import static android.os.Process.myUserHandle;
import static android.platform.test.flag.junit.SetFlagsRule.DefaultInitValueType.DEVICE_DEFAULT;
@@ -51,7 +51,6 @@ import androidx.test.uiautomator.BySelector;
import androidx.test.uiautomator.UiDevice;
import androidx.test.uiautomator.Until;
-import com.android.launcher3.celllayout.FavoriteItemsTransaction;
import com.android.launcher3.tapl.HomeAllApps;
import com.android.launcher3.tapl.HomeAppIcon;
import com.android.launcher3.tapl.LauncherInstrumentation;
@@ -65,6 +64,7 @@ import com.android.launcher3.util.rule.ScreenRecordRule;
import com.android.launcher3.util.rule.ShellCommandRule;
import com.android.launcher3.util.rule.TestIsolationRule;
import com.android.launcher3.util.rule.TestStabilityRule;
+import com.android.launcher3.util.workspace.FavoriteItemsTransaction;
import org.junit.After;
import org.junit.Assert;
diff --git a/tests/src/com/android/launcher3/ui/PortraitLandscapeRunner.java b/tests/src/com/android/launcher3/util/ui/PortraitLandscapeRunner.java
similarity index 87%
rename from tests/src/com/android/launcher3/ui/PortraitLandscapeRunner.java
rename to tests/src/com/android/launcher3/util/ui/PortraitLandscapeRunner.java
index 7784c03431..e5b45b9277 100644
--- a/tests/src/com/android/launcher3/ui/PortraitLandscapeRunner.java
+++ b/tests/src/com/android/launcher3/util/ui/PortraitLandscapeRunner.java
@@ -1,4 +1,20 @@
-package com.android.launcher3.ui;
+/*
+ * Copyright (C) 2025 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.util.ui;
import static com.android.launcher3.LauncherPrefs.FIXED_LANDSCAPE_MODE;
diff --git a/tests/src/com/android/launcher3/util/viewcapture_analysis/Android.bp b/tests/src/com/android/launcher3/util/viewcapture_analysis/Android.bp
new file mode 100644
index 0000000000..6e749e6d37
--- /dev/null
+++ b/tests/src/com/android/launcher3/util/viewcapture_analysis/Android.bp
@@ -0,0 +1,10 @@
+filegroup {
+ name: "launcher-viewcapture-analysis",
+ srcs: [
+ "FlashDetector.java",
+ "AlphaJumpDetector.java",
+ "AnomalyDetector.java",
+ "PositionJumpDetector.java",
+ "ViewCaptureAnalyzer.java",
+ ],
+}
diff --git a/tests/src/com/android/launcher3/ui/widget/AddConfigWidgetTest.java b/tests/src/com/android/launcher3/widget/AddConfigWidgetTest.java
similarity index 94%
rename from tests/src/com/android/launcher3/ui/widget/AddConfigWidgetTest.java
rename to tests/src/com/android/launcher3/widget/AddConfigWidgetTest.java
index f777049f0a..cde9d80381 100644
--- a/tests/src/com/android/launcher3/ui/widget/AddConfigWidgetTest.java
+++ b/tests/src/com/android/launcher3/widget/AddConfigWidgetTest.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.launcher3.ui.widget;
+package com.android.launcher3.widget;
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
@@ -34,21 +34,18 @@ import androidx.test.filters.LargeTest;
import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.Launcher;
-import com.android.launcher3.celllayout.FavoriteItemsTransaction;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.LauncherAppWidgetInfo;
import com.android.launcher3.testcomponent.WidgetConfigActivity;
-import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape;
-import com.android.launcher3.ui.TestViewHelpers;
import com.android.launcher3.util.BaseLauncherActivityTest;
import com.android.launcher3.util.BlockingBroadcastReceiver;
import com.android.launcher3.util.PackageUserKey;
import com.android.launcher3.util.Wait;
import com.android.launcher3.util.rule.ShellCommandRule;
+import com.android.launcher3.util.ui.PortraitLandscapeRunner.PortraitLandscape;
+import com.android.launcher3.util.ui.TestViewHelpers;
+import com.android.launcher3.util.workspace.FavoriteItemsTransaction;
import com.android.launcher3.views.OptionsPopupView;
-import com.android.launcher3.widget.LauncherAppWidgetProviderInfo;
-import com.android.launcher3.widget.PendingAddWidgetInfo;
-import com.android.launcher3.widget.WidgetCell;
import com.android.launcher3.widget.picker.WidgetsFullSheet;
import com.android.launcher3.widget.picker.WidgetsListAdapter;
import com.android.launcher3.widget.picker.WidgetsRecyclerView;
diff --git a/tests/src/com/android/launcher3/ui/widget/BindWidgetTest.java b/tests/src/com/android/launcher3/widget/BindWidgetTest.java
similarity index 96%
rename from tests/src/com/android/launcher3/ui/widget/BindWidgetTest.java
rename to tests/src/com/android/launcher3/widget/BindWidgetTest.java
index d17f5a95dd..1bfd5a9a34 100644
--- a/tests/src/com/android/launcher3/ui/widget/BindWidgetTest.java
+++ b/tests/src/com/android/launcher3/widget/BindWidgetTest.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.launcher3.ui.widget;
+package com.android.launcher3.widget;
import static com.android.launcher3.WorkspaceLayoutManager.FIRST_SCREEN_ID;
import static com.android.launcher3.model.data.LauncherAppWidgetInfo.FLAG_ID_NOT_VALID;
@@ -46,16 +46,12 @@ import com.android.launcher3.LauncherAppState;
import com.android.launcher3.LauncherModel;
import com.android.launcher3.LauncherSettings;
import com.android.launcher3.R;
-import com.android.launcher3.celllayout.FavoriteItemsTransaction;
import com.android.launcher3.model.data.LauncherAppWidgetInfo;
import com.android.launcher3.pm.InstallSessionHelper;
-import com.android.launcher3.ui.TestViewHelpers;
import com.android.launcher3.util.BaseLauncherActivityTest;
import com.android.launcher3.util.rule.ShellCommandRule;
-import com.android.launcher3.widget.LauncherAppWidgetHostView;
-import com.android.launcher3.widget.LauncherAppWidgetProviderInfo;
-import com.android.launcher3.widget.PendingAppWidgetHostView;
-import com.android.launcher3.widget.WidgetManagerHelper;
+import com.android.launcher3.util.ui.TestViewHelpers;
+import com.android.launcher3.util.workspace.FavoriteItemsTransaction;
import org.junit.After;
import org.junit.Before;
diff --git a/tests/src/com/android/launcher3/ui/widget/RequestPinItemTest.java b/tests/src/com/android/launcher3/widget/RequestPinItemTest.java
similarity index 98%
rename from tests/src/com/android/launcher3/ui/widget/RequestPinItemTest.java
rename to tests/src/com/android/launcher3/widget/RequestPinItemTest.java
index 91ad341440..393dc56f63 100644
--- a/tests/src/com/android/launcher3/ui/widget/RequestPinItemTest.java
+++ b/tests/src/com/android/launcher3/widget/RequestPinItemTest.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.launcher3.ui.widget;
+package com.android.launcher3.widget;
import static android.app.PendingIntent.FLAG_MUTABLE;
import static android.app.PendingIntent.FLAG_ONE_SHOT;
@@ -39,7 +39,6 @@ import androidx.test.uiautomator.BySelector;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherSettings.Favorites;
-import com.android.launcher3.celllayout.FavoriteItemsTransaction;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.LauncherAppWidgetInfo;
import com.android.launcher3.model.data.WorkspaceItemInfo;
@@ -53,6 +52,7 @@ import com.android.launcher3.util.LauncherBindableItemsContainer.ItemOperator;
import com.android.launcher3.util.TestUtil;
import com.android.launcher3.util.rule.ScreenRecordRule;
import com.android.launcher3.util.rule.ShellCommandRule;
+import com.android.launcher3.util.workspace.FavoriteItemsTransaction;
import org.junit.Before;
import org.junit.Rule;
diff --git a/tests/src/com/android/launcher3/ui/widget/TaplAddWidgetTest.java b/tests/src/com/android/launcher3/widget/TaplAddWidgetTest.java
similarity index 92%
rename from tests/src/com/android/launcher3/ui/widget/TaplAddWidgetTest.java
rename to tests/src/com/android/launcher3/widget/TaplAddWidgetTest.java
index fda4f7cb55..b18b6497e3 100644
--- a/tests/src/com/android/launcher3/ui/widget/TaplAddWidgetTest.java
+++ b/tests/src/com/android/launcher3/widget/TaplAddWidgetTest.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-package com.android.launcher3.ui.widget;
+package com.android.launcher3.widget;
import static org.junit.Assert.assertNotNull;
@@ -24,15 +24,14 @@ import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.LargeTest;
import com.android.launcher3.Launcher;
-import com.android.launcher3.celllayout.FavoriteItemsTransaction;
import com.android.launcher3.tapl.Widget;
import com.android.launcher3.tapl.WidgetResizeFrame;
-import com.android.launcher3.ui.AbstractLauncherUiTest;
-import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape;
-import com.android.launcher3.ui.TestViewHelpers;
import com.android.launcher3.util.TestUtil;
import com.android.launcher3.util.rule.ShellCommandRule;
-import com.android.launcher3.widget.LauncherAppWidgetProviderInfo;
+import com.android.launcher3.util.ui.AbstractLauncherUiTest;
+import com.android.launcher3.util.ui.PortraitLandscapeRunner.PortraitLandscape;
+import com.android.launcher3.util.ui.TestViewHelpers;
+import com.android.launcher3.util.workspace.FavoriteItemsTransaction;
import org.junit.Assume;
import org.junit.Rule;
diff --git a/tests/src/com/android/launcher3/ui/widget/WidgetPickerTest.java b/tests/src/com/android/launcher3/widget/picker/WidgetPickerTest.java
similarity index 93%
rename from tests/src/com/android/launcher3/ui/widget/WidgetPickerTest.java
rename to tests/src/com/android/launcher3/widget/picker/WidgetPickerTest.java
index 7d9843a22f..9adc95c7bc 100644
--- a/tests/src/com/android/launcher3/ui/widget/WidgetPickerTest.java
+++ b/tests/src/com/android/launcher3/widget/picker/WidgetPickerTest.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.launcher3.ui.widget;
+package com.android.launcher3.widget.picker;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@@ -24,13 +24,11 @@ import androidx.test.filters.MediumTest;
import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.Launcher;
-import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape;
import com.android.launcher3.util.BaseLauncherActivityTest;
import com.android.launcher3.util.rule.ScreenRecordRule;
import com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord;
+import com.android.launcher3.util.ui.PortraitLandscapeRunner.PortraitLandscape;
import com.android.launcher3.views.OptionsPopupView;
-import com.android.launcher3.widget.picker.WidgetsFullSheet;
-import com.android.launcher3.widget.picker.WidgetsRecyclerView;
import org.junit.Rule;
import org.junit.Test;
diff --git a/tests/src/com/android/launcher3/ui/workspace/TaplTwoPanelWorkspaceTest.java b/tests/src/com/android/launcher3/workspace/TaplTwoPanelWorkspaceTest.java
similarity index 98%
rename from tests/src/com/android/launcher3/ui/workspace/TaplTwoPanelWorkspaceTest.java
rename to tests/src/com/android/launcher3/workspace/TaplTwoPanelWorkspaceTest.java
index 7081768b70..bac2e41007 100644
--- a/tests/src/com/android/launcher3/ui/workspace/TaplTwoPanelWorkspaceTest.java
+++ b/tests/src/com/android/launcher3/workspace/TaplTwoPanelWorkspaceTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher3.ui.workspace;
+package com.android.launcher3.workspace;
import static com.android.launcher3.util.TestConstants.AppNames.CHROME_APP_NAME;
import static com.android.launcher3.util.TestConstants.AppNames.MAPS_APP_NAME;
@@ -35,10 +35,10 @@ import com.android.launcher3.CellLayout;
import com.android.launcher3.Launcher;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.tapl.Workspace;
-import com.android.launcher3.ui.AbstractLauncherUiTest;
-import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape;
import com.android.launcher3.util.LauncherLayoutBuilder;
import com.android.launcher3.util.TestUtil;
+import com.android.launcher3.util.ui.AbstractLauncherUiTest;
+import com.android.launcher3.util.ui.PortraitLandscapeRunner.PortraitLandscape;
import org.junit.After;
import org.junit.Before;
@@ -372,4 +372,4 @@ public class TaplTwoPanelWorkspaceTest extends AbstractLauncherUiTest