Merge "Remove ENABLE_ONE_SEARCH" into tm-dev
diff --git a/Android.bp b/Android.bp
index 3aa9394..5a153a7 100644
--- a/Android.bp
+++ b/Android.bp
@@ -226,6 +226,21 @@
],
}
+// Common source files used to build go launcher
+filegroup {
+ name: "launcher-go-src-no-build-config",
+ srcs: [
+ "src/**/*.java",
+ "src/**/*.kt",
+ "quickstep/src/**/*.java",
+ "quickstep/src/**/*.kt",
+ "go/src/**/*.java",
+ "go/src/**/*.kt",
+ "go/quickstep/src/**/*.java",
+ "go/quickstep/src/**/*.kt",
+ ],
+}
+
// Proguard files for Launcher3
filegroup {
name: "launcher-proguard-rules",
diff --git a/quickstep/src/com/android/quickstep/BaseActivityInterface.java b/quickstep/src/com/android/quickstep/BaseActivityInterface.java
index 6584f88..9686510 100644
--- a/quickstep/src/com/android/quickstep/BaseActivityInterface.java
+++ b/quickstep/src/com/android/quickstep/BaseActivityInterface.java
@@ -362,10 +362,9 @@
/** Gets the space that the overview actions will take, including bottom margin. */
private int getOverviewActionsHeight(Context context, DeviceProfile dp) {
- Resources res = context.getResources();
return OverviewActionsView.getOverviewActionsBottomMarginPx(getNavigationMode(context), dp)
+ OverviewActionsView.getOverviewActionsTopMarginPx(getNavigationMode(context), dp)
- + res.getDimensionPixelSize(R.dimen.overview_actions_height);
+ + dp.overviewActionsHeight;
}
/**
diff --git a/quickstep/src/com/android/quickstep/SystemUiProxy.java b/quickstep/src/com/android/quickstep/SystemUiProxy.java
index d8cbd36..5ef89d3 100644
--- a/quickstep/src/com/android/quickstep/SystemUiProxy.java
+++ b/quickstep/src/com/android/quickstep/SystemUiProxy.java
@@ -99,7 +99,7 @@
private ILauncherUnlockAnimationController mPendingLauncherUnlockAnimationController;
private IRecentTasksListener mRecentTasksListener;
private final ArrayList<RemoteTransitionCompat> mRemoteTransitions = new ArrayList<>();
- private IOnBackInvokedCallback mBackToLaunchCallback;
+ private IOnBackInvokedCallback mBackToLauncherCallback;
// Used to dedupe calls to SystemUI
private int mLastShelfHeight;
@@ -200,8 +200,8 @@
if (mRecentTasksListener != null && mRecentTasks != null) {
registerRecentTasksListener(mRecentTasksListener);
}
- if (mBackAnimation != null && mBackToLaunchCallback != null) {
- setBackToLauncherCallback(mBackToLaunchCallback);
+ if (mBackAnimation != null && mBackToLauncherCallback != null) {
+ setBackToLauncherCallback(mBackToLauncherCallback);
}
if (mPendingSetNavButtonAlpha != null) {
@@ -836,7 +836,7 @@
/** Sets the launcher {@link android.window.IOnBackInvokedCallback} to shell */
public void setBackToLauncherCallback(IOnBackInvokedCallback callback) {
- mBackToLaunchCallback = callback;
+ mBackToLauncherCallback = callback;
if (mBackAnimation == null) {
return;
}
@@ -849,6 +849,7 @@
/** Clears the previously registered {@link IOnBackInvokedCallback}. */
public void clearBackToLauncherCallback() {
+ mBackToLauncherCallback = null;
if (mBackAnimation == null) {
return;
}
diff --git a/quickstep/src/com/android/quickstep/views/OverviewActionsView.java b/quickstep/src/com/android/quickstep/views/OverviewActionsView.java
index 0fa2b24..6b15807 100644
--- a/quickstep/src/com/android/quickstep/views/OverviewActionsView.java
+++ b/quickstep/src/com/android/quickstep/views/OverviewActionsView.java
@@ -216,14 +216,12 @@
// Align vertically, using taskbar height + mDp.taskbarOffsetY() to estimate where
// the button nav top is.
- View startActionView = findViewById(R.id.action_screenshot);
int marginBottom = getOverviewActionsBottomMarginPx(
DisplayController.getNavigationMode(getContext()), mDp);
int actionsTop =
- (mDp.heightPx - marginBottom - mInsets.bottom) - startActionView.getHeight();
+ (mDp.heightPx - marginBottom - mInsets.bottom) - mDp.overviewActionsHeight;
int navTop = mDp.heightPx - (mDp.taskbarSize + mDp.getTaskbarOffsetY());
- int transY = navTop - actionsTop
- + ((mDp.taskbarSize - startActionView.getHeight()) / 2);
+ int transY = navTop - actionsTop + ((mDp.taskbarSize - mDp.overviewActionsHeight) / 2);
setTranslationY(transY);
} else {
setPadding(mInsets.left, 0, mInsets.right, 0);
diff --git a/quickstep/tests/src/com/android/quickstep/DigitalWellBeingToastTest.java b/quickstep/tests/src/com/android/quickstep/DigitalWellBeingToastTest.java
index 3e84a76..3bd3722 100644
--- a/quickstep/tests/src/com/android/quickstep/DigitalWellBeingToastTest.java
+++ b/quickstep/tests/src/com/android/quickstep/DigitalWellBeingToastTest.java
@@ -48,7 +48,7 @@
Duration.ofSeconds(600), Duration.ofSeconds(300),
PendingIntent.getActivity(mTargetContext, -1, new Intent(), 0)));
- mLauncher.pressHome();
+ mLauncher.goHome();
final DigitalWellBeingToast toast = getToast();
waitForLauncherCondition("Toast is not visible", launcher -> toast.hasLimit());
@@ -58,7 +58,7 @@
runWithShellPermission(
() -> usageStatsManager.unregisterAppUsageLimitObserver(observerId));
- mLauncher.pressHome();
+ mLauncher.goHome();
assertFalse("Toast is visible", getToast().hasLimit());
} finally {
runWithShellPermission(
diff --git a/quickstep/tests/src/com/android/quickstep/StartLauncherViaGestureTests.java b/quickstep/tests/src/com/android/quickstep/StartLauncherViaGestureTests.java
index 5351963..6ec6269 100644
--- a/quickstep/tests/src/com/android/quickstep/StartLauncherViaGestureTests.java
+++ b/quickstep/tests/src/com/android/quickstep/StartLauncherViaGestureTests.java
@@ -41,7 +41,7 @@
super.setUp();
TaplTestsLauncher3.initialize(this);
// b/143488140
- mLauncher.pressHome();
+ mLauncher.goHome();
// Start an activity where the gestures start.
startAppFast(resolveSystemApp(Intent.CATEGORY_APP_CALCULATOR));
}
@@ -54,7 +54,7 @@
// The test action.
eventProcessor.startIteration();
- mLauncher.pressHome();
+ mLauncher.goHome();
eventProcessor.finishIteration();
}
@@ -66,7 +66,7 @@
closeLauncherActivity();
// The test action.
- mLauncher.pressHome();
+ mLauncher.goHome();
}
}
@@ -81,6 +81,6 @@
mLauncher.getLaunchedAppState().switchToOverview();
}
closeLauncherActivity();
- mLauncher.pressHome();
+ mLauncher.goHome();
}
}
diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
index 396cb1b..399cd10 100644
--- a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
+++ b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
@@ -102,7 +102,7 @@
public void testOverview() throws Exception {
startTestAppsWithCheck();
// mLauncher.pressHome() also tests an important case of pressing home while in background.
- Overview overview = mLauncher.pressHome().switchToOverview();
+ Overview overview = mLauncher.goHome().switchToOverview();
assertTrue("Launcher internal state didn't switch to Overview",
isInState(() -> LauncherState.OVERVIEW));
executeOnLauncher(
@@ -127,7 +127,7 @@
getCurrentOverviewPage(launcher) < currentTaskAfterFlingForward));
// Test opening a task.
- OverviewTask task = mLauncher.pressHome().switchToOverview().getCurrentTask();
+ OverviewTask task = mLauncher.goHome().switchToOverview().getCurrentTask();
assertNotNull("overview.getCurrentTask() returned null (1)", task);
assertNotNull("OverviewTask.open returned null", task.open());
assertTrue("Test activity didn't open from Overview", mDevice.wait(Until.hasObject(
@@ -139,7 +139,7 @@
isInLaunchedApp(launcher)));
// Test dismissing a task.
- overview = mLauncher.pressHome().switchToOverview();
+ overview = mLauncher.goHome().switchToOverview();
assertTrue("Launcher internal state didn't switch to Overview",
isInState(() -> LauncherState.OVERVIEW));
final Integer numTasks = getFromLauncher(launcher -> getTaskCount(launcher));
@@ -151,7 +151,7 @@
numTasks - 1, getTaskCount(launcher)));
// Test dismissing all tasks.
- mLauncher.pressHome().switchToOverview().dismissAllTasks();
+ mLauncher.goHome().switchToOverview().dismissAllTasks();
assertTrue("Launcher internal state is not Home",
isInState(() -> LauncherState.NORMAL));
executeOnLauncher(
@@ -168,14 +168,14 @@
@ScreenRecord // b/195673272
public void testOverviewActions() throws Exception {
// Experimenting for b/165029151:
- final Overview overview = mLauncher.pressHome().switchToOverview();
+ final Overview overview = mLauncher.goHome().switchToOverview();
if (overview.hasTasks()) overview.dismissAllTasks();
- mLauncher.pressHome();
+ mLauncher.goHome();
//
startTestAppsWithCheck();
OverviewActions actionsView =
- mLauncher.pressHome().switchToOverview().getOverviewActions();
+ mLauncher.goHome().switchToOverview().getOverviewActions();
actionsView.clickAndDismissScreenshot();
}
@@ -200,7 +200,7 @@
@PortraitLandscape
public void testSwitchToOverview() throws Exception {
assertNotNull("Workspace.switchToOverview() returned null",
- mLauncher.pressHome().switchToOverview());
+ mLauncher.goHome().switchToOverview());
assertTrue("Launcher internal state didn't switch to Overview",
isInState(() -> LauncherState.OVERVIEW));
}
@@ -240,7 +240,7 @@
// Testing pressHome.
assertTrue("Launcher internal state is not All Apps",
isInState(() -> LauncherState.ALL_APPS));
- assertNotNull("pressHome returned null", mLauncher.pressHome());
+ assertNotNull("pressHome returned null", mLauncher.goHome());
assertTrue("Launcher internal state is not Home",
isInState(() -> LauncherState.NORMAL));
assertNotNull("getHome returned null", mLauncher.getWorkspace());
@@ -289,7 +289,7 @@
@PortraitLandscape
public void testQuickSwitchFromHome() throws Exception {
startTestActivity(2);
- mLauncher.pressHome().quickSwitchToPreviousApp();
+ mLauncher.goHome().quickSwitchToPreviousApp();
assertTrue("The most recent task is not running after quick switching from home",
isTestActivityRunning(2));
getAndAssertLaunchedApp();
@@ -329,7 +329,7 @@
startTestActivity(i);
}
- Overview overview = mLauncher.pressHome().switchToOverview();
+ Overview overview = mLauncher.goHome().switchToOverview();
executeOnLauncher(
launcher -> assertTrue("Don't have at least 13 tasks",
getTaskCount(launcher) >= 13));
@@ -348,7 +348,7 @@
DEFAULT_UI_TIMEOUT));
// Scroll the task offscreen as it is now first
- overview = mLauncher.pressHome().switchToOverview();
+ overview = mLauncher.goHome().switchToOverview();
overview.scrollCurrentTaskOffScreen();
assertTrue("Launcher internal state is not Overview",
isInState(() -> LauncherState.OVERVIEW));
@@ -377,7 +377,7 @@
launcher)) <= 1)));
// Test dismissing all tasks.
- mLauncher.pressHome().switchToOverview().dismissAllTasks();
+ mLauncher.goHome().switchToOverview().dismissAllTasks();
assertTrue("Launcher internal state is not Home",
isInState(() -> LauncherState.NORMAL));
executeOnLauncher(
diff --git a/quickstep/tests/src/com/android/quickstep/ViewInflationDuringSwipeUp.java b/quickstep/tests/src/com/android/quickstep/ViewInflationDuringSwipeUp.java
index 661beda..7e408a8 100644
--- a/quickstep/tests/src/com/android/quickstep/ViewInflationDuringSwipeUp.java
+++ b/quickstep/tests/src/com/android/quickstep/ViewInflationDuringSwipeUp.java
@@ -197,7 +197,7 @@
addItemToScreen(item);
assertTrue("Widget is not present",
- mLauncher.pressHome().tryGetWidget(info.label, DEFAULT_UI_TIMEOUT) != null);
+ mLauncher.goHome().tryGetWidget(info.label, DEFAULT_UI_TIMEOUT) != null);
int widgetId = item.appWidgetId;
// Verify widget id
@@ -221,7 +221,7 @@
// Widget is updated when going home
mInitTracker.disableLog();
- mLauncher.pressHome();
+ mLauncher.goHome();
verifyWidget(finalWidgetText);
assertNotEquals(1, mInitTracker.viewInitCount);
} finally {
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 3e666fc..2b599bc 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -345,6 +345,7 @@
<dimen name="task_thumbnail_icon_drawable_size_grid">0dp</dimen>
<dimen name="overview_task_margin">0dp</dimen>
<dimen name="overview_task_margin_grid">0dp</dimen>
+ <dimen name="overview_actions_height">0dp</dimen>
<dimen name="overview_actions_button_spacing">0dp</dimen>
<dimen name="overview_actions_margin_gesture">0dp</dimen>
<dimen name="overview_actions_top_margin_gesture">0dp</dimen>
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index 1b333d8..39020bd 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -191,6 +191,7 @@
public int overviewTaskIconDrawableSizePx;
public int overviewTaskIconDrawableSizeGridPx;
public int overviewTaskThumbnailTopMarginPx;
+ public final int overviewActionsHeight;
public final int overviewActionsMarginThreeButtonPx;
public final int overviewActionsTopMarginGesturePx;
public final int overviewActionsBottomMarginGesturePx;
@@ -407,6 +408,7 @@
overviewPageSpacing = res.getDimensionPixelSize(R.dimen.overview_page_spacing);
overviewActionsButtonSpacing = res.getDimensionPixelSize(
R.dimen.overview_actions_button_spacing);
+ overviewActionsHeight = res.getDimensionPixelSize(R.dimen.overview_actions_height);
overviewActionsMarginThreeButtonPx = res.getDimensionPixelSize(
R.dimen.overview_actions_margin_three_button);
// Grid task's top margin is only overviewTaskIconSizePx + overviewTaskMarginGridPx, but
diff --git a/src/com/android/launcher3/LauncherProvider.java b/src/com/android/launcher3/LauncherProvider.java
index 85ee8bc..5aa8a46 100644
--- a/src/com/android/launcher3/LauncherProvider.java
+++ b/src/com/android/launcher3/LauncherProvider.java
@@ -162,6 +162,7 @@
private synchronized boolean prepForMigration(String dbFile, String targetTableName,
Supplier<DatabaseHelper> src, Supplier<DatabaseHelper> dst) {
if (TextUtils.equals(dbFile, mOpenHelper.getDatabaseName())) {
+ Log.e("b/198965093", "prepForMigration - target db is same as current: " + dbFile);
return false;
}
@@ -439,7 +440,7 @@
Bundle result = new Bundle();
result.putBoolean(LauncherSettings.Settings.EXTRA_VALUE,
prepForMigration(
- InvariantDeviceProfile.INSTANCE.get(getContext()).dbFile,
+ arg /* dbFile */,
Favorites.TMP_TABLE,
() -> mOpenHelper,
() -> DatabaseHelper.createDatabaseHelper(
diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java
index 588f2a2..df42355 100644
--- a/src/com/android/launcher3/config/FeatureFlags.java
+++ b/src/com/android/launcher3/config/FeatureFlags.java
@@ -52,7 +52,7 @@
* 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.
*/
- public static final boolean QSB_ON_FIRST_SCREEN = true;
+ 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/model/DeviceGridState.java b/src/com/android/launcher3/model/DeviceGridState.java
index 3e49d79..35fcb78 100644
--- a/src/com/android/launcher3/model/DeviceGridState.java
+++ b/src/com/android/launcher3/model/DeviceGridState.java
@@ -43,15 +43,18 @@
public static final String KEY_WORKSPACE_SIZE = "migration_src_workspace_size";
public static final String KEY_HOTSEAT_COUNT = "migration_src_hotseat_count";
public static final String KEY_DEVICE_TYPE = "migration_src_device_type";
+ public static final String KEY_DB_FILE = "migration_src_db_file";
private final String mGridSizeString;
private final int mNumHotseat;
private final @DeviceType int mDeviceType;
+ private final String mDbFile;
public DeviceGridState(InvariantDeviceProfile idp) {
mGridSizeString = String.format(Locale.ENGLISH, "%d,%d", idp.numColumns, idp.numRows);
mNumHotseat = idp.numDatabaseHotseatIcons;
mDeviceType = idp.deviceType;
+ mDbFile = idp.dbFile;
}
public DeviceGridState(Context context) {
@@ -59,6 +62,7 @@
mGridSizeString = prefs.getString(KEY_WORKSPACE_SIZE, "");
mNumHotseat = prefs.getInt(KEY_HOTSEAT_COUNT, -1);
mDeviceType = prefs.getInt(KEY_DEVICE_TYPE, TYPE_PHONE);
+ mDbFile = prefs.getString(KEY_DB_FILE, "");
}
/**
@@ -69,6 +73,20 @@
}
/**
+ * Returns the databaseFile for the grid.
+ */
+ public String getDbFile() {
+ return mDbFile;
+ }
+
+ /**
+ * Returns the number of hotseat icons.
+ */
+ public int getNumHotseat() {
+ return mNumHotseat;
+ }
+
+ /**
* Stores the device state to shared preferences
*/
public void writeToPrefs(Context context) {
@@ -76,6 +94,7 @@
.putString(KEY_WORKSPACE_SIZE, mGridSizeString)
.putInt(KEY_HOTSEAT_COUNT, mNumHotseat)
.putInt(KEY_DEVICE_TYPE, mDeviceType)
+ .putString(KEY_DB_FILE, mDbFile)
.apply();
}
@@ -106,6 +125,7 @@
+ "mGridSizeString='" + mGridSizeString + '\''
+ ", mNumHotseat=" + mNumHotseat
+ ", mDeviceType=" + mDeviceType
+ + ", mDbFile=" + mDbFile
+ '}';
}
diff --git a/src/com/android/launcher3/model/GridSizeMigrationTaskV2.java b/src/com/android/launcher3/model/GridSizeMigrationTaskV2.java
index 74b0a6f..0369b21 100644
--- a/src/com/android/launcher3/model/GridSizeMigrationTaskV2.java
+++ b/src/com/android/launcher3/model/GridSizeMigrationTaskV2.java
@@ -22,7 +22,6 @@
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
-import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.database.Cursor;
@@ -104,13 +103,16 @@
* Check given a new IDP, if migration is necessary.
*/
public static boolean needsToMigrate(Context context, InvariantDeviceProfile idp) {
- DeviceGridState idpGridState = new DeviceGridState(idp);
- DeviceGridState contextGridState = new DeviceGridState(context);
- boolean needsToMigrate = !idpGridState.isCompatible(contextGridState);
+ return needsToMigrate(new DeviceGridState(context), new DeviceGridState(idp));
+ }
+
+ private static boolean needsToMigrate(
+ DeviceGridState srcDeviceState, DeviceGridState destDeviceState) {
+ boolean needsToMigrate = !destDeviceState.isCompatible(srcDeviceState);
// TODO(b/198965093): Revert this change after bug is fixed
if (needsToMigrate) {
- Log.d("b/198965093", "Migration is needed. idpGridState: " + idpGridState
- + ", contextGridState: " + contextGridState);
+ Log.d("b/198965093", "Migration is needed. destDeviceState: " + destDeviceState
+ + ", srcDeviceState: " + srcDeviceState);
}
return needsToMigrate;
}
@@ -143,23 +145,26 @@
idp = LauncherAppState.getIDP(context);
}
- if (!needsToMigrate(context, idp)) {
+ DeviceGridState srcDeviceState = new DeviceGridState(context);
+ DeviceGridState destDeviceState = new DeviceGridState(idp);
+ if (!needsToMigrate(srcDeviceState, destDeviceState)) {
return true;
}
- SharedPreferences prefs = Utilities.getPrefs(context);
HashSet<String> validPackages = getValidPackages(context);
if (migrateForPreview) {
if (!LauncherSettings.Settings.call(
context.getContentResolver(),
- LauncherSettings.Settings.METHOD_PREP_FOR_PREVIEW, idp.dbFile).getBoolean(
+ LauncherSettings.Settings.METHOD_PREP_FOR_PREVIEW,
+ destDeviceState.getDbFile()).getBoolean(
LauncherSettings.Settings.EXTRA_VALUE)) {
return false;
}
} else if (!LauncherSettings.Settings.call(
context.getContentResolver(),
- LauncherSettings.Settings.METHOD_UPDATE_CURRENT_OPEN_HELPER).getBoolean(
+ LauncherSettings.Settings.METHOD_UPDATE_CURRENT_OPEN_HELPER,
+ destDeviceState.getDbFile()).getBoolean(
LauncherSettings.Settings.EXTRA_VALUE)) {
return false;
}
@@ -179,10 +184,10 @@
: LauncherSettings.Favorites.TABLE_NAME,
context, validPackages);
- Point targetSize = new Point(idp.numColumns, idp.numRows);
+ Point targetSize = new Point(destDeviceState.getColumns(), destDeviceState.getRows());
GridSizeMigrationTaskV2 task = new GridSizeMigrationTaskV2(context, t.getDb(),
- srcReader, destReader, idp.numDatabaseHotseatIcons, targetSize);
- task.migrate(idp);
+ srcReader, destReader, destDeviceState.getNumHotseat(), targetSize);
+ task.migrate(srcDeviceState, destDeviceState);
if (!migrateForPreview) {
dropTable(t.getDb(), LauncherSettings.Favorites.TMP_TABLE);
@@ -200,13 +205,13 @@
if (!migrateForPreview) {
// Save current configuration, so that the migration does not run again.
- new DeviceGridState(idp).writeToPrefs(context);
+ destDeviceState.writeToPrefs(context);
}
}
}
@VisibleForTesting
- protected boolean migrate(InvariantDeviceProfile idp) {
+ protected boolean migrate(DeviceGridState srcDeviceState, DeviceGridState destDeviceState) {
if (mHotseatDiff.isEmpty() && mWorkspaceDiff.isEmpty()) {
return false;
}
@@ -228,8 +233,6 @@
boolean preservePages = false;
if (screens.isEmpty() && FeatureFlags.ENABLE_NEW_MIGRATION_LOGIC.get()) {
- DeviceGridState srcDeviceState = new DeviceGridState(mContext);
- DeviceGridState destDeviceState = new DeviceGridState(idp);
preservePages = destDeviceState.compareTo(srcDeviceState) >= 0
&& destDeviceState.getColumns() - srcDeviceState.getColumns() <= 2;
}
diff --git a/src_build_config/com/android/launcher3/BuildConfig.java b/src_build_config/com/android/launcher3/BuildConfig.java
index 49aadf6..9a81d3f 100644
--- a/src_build_config/com/android/launcher3/BuildConfig.java
+++ b/src_build_config/com/android/launcher3/BuildConfig.java
@@ -17,6 +17,11 @@
package com.android.launcher3;
public final class BuildConfig {
- public static final String APPLICATION_ID = "com.android.launcher3";
- public static final boolean DEBUG = false;
+ public static final String APPLICATION_ID = "com.android.launcher3";
+ public static final boolean DEBUG = false;
+ /**
+ * Flag to state if the QSB is on the first screen and placed on the top,
+ * this can be overwritten in other launchers with a different value, if needed.
+ */
+ public static final boolean QSB_ON_FIRST_SCREEN = true;
}
diff --git a/tests/src/com/android/launcher3/model/GridSizeMigrationTaskV2Test.kt b/tests/src/com/android/launcher3/model/GridSizeMigrationTaskV2Test.kt
index 239e092..345016b 100644
--- a/tests/src/com/android/launcher3/model/GridSizeMigrationTaskV2Test.kt
+++ b/tests/src/com/android/launcher3/model/GridSizeMigrationTaskV2Test.kt
@@ -125,7 +125,7 @@
idp.numDatabaseHotseatIcons,
Point(idp.numColumns, idp.numRows)
)
- task.migrate(idp)
+ task.migrate(DeviceGridState(context), DeviceGridState(idp))
// Check hotseat items
var c = context.contentResolver.query(
@@ -205,7 +205,7 @@
idp.numDatabaseHotseatIcons,
Point(idp.numColumns, idp.numRows)
)
- task.migrate(idp)
+ task.migrate(DeviceGridState(context), DeviceGridState(idp))
// Check hotseat items
val c = context.contentResolver.query(
@@ -260,7 +260,7 @@
idp.numDatabaseHotseatIcons,
Point(idp.numColumns, idp.numRows)
)
- task.migrate(idp)
+ task.migrate(DeviceGridState(context), DeviceGridState(idp))
// Check hotseat items
val c = context.contentResolver.query(
@@ -325,7 +325,7 @@
idp.numDatabaseHotseatIcons,
Point(idp.numColumns, idp.numRows)
)
- task.migrate(idp)
+ task.migrate(DeviceGridState(context), DeviceGridState(idp))
// Get workspace items
val c = context.contentResolver.query(
@@ -385,7 +385,7 @@
idp.numDatabaseHotseatIcons,
Point(idp.numColumns, idp.numRows)
)
- task.migrate(idp)
+ task.migrate(DeviceGridState(context), DeviceGridState(idp))
// Get workspace items
val c = context.contentResolver.query(
@@ -446,7 +446,7 @@
idp.numDatabaseHotseatIcons,
Point(idp.numColumns, idp.numRows)
)
- task.migrate(idp)
+ task.migrate(DeviceGridState(context), DeviceGridState(idp))
// Get workspace items
val c = context.contentResolver.query(
diff --git a/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java b/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java
index 61ec8bd..73e9823 100644
--- a/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java
+++ b/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java
@@ -109,7 +109,7 @@
launcher -> assertNotNull("Launcher internal state didn't switch to Showing Menu",
launcher.getOptionsPopup()));
// Check that pressHome works when the menu is shown.
- mLauncher.pressHome();
+ mLauncher.goHome();
}
@Test
@@ -121,7 +121,7 @@
} finally {
allApps.unfreeze();
}
- mLauncher.pressHome();
+ mLauncher.goHome();
}
public static void runAllAppsTest(AbstractLauncherUiTest test, AllApps allApps) {
@@ -273,7 +273,7 @@
executeOnLauncher(launcher -> assertTrue("Flinging backward didn't scroll widgets",
getWidgetsScroll(launcher) < flingForwardY));
- mLauncher.pressHome();
+ mLauncher.goHome();
waitForLauncherCondition("Widgets were not closed",
launcher -> getWidgetsView(launcher) == null);
}
diff --git a/tests/src/com/android/launcher3/ui/widget/RequestPinItemTest.java b/tests/src/com/android/launcher3/ui/widget/RequestPinItemTest.java
index 0c1f0cd..9fb52fc 100644
--- a/tests/src/com/android/launcher3/ui/widget/RequestPinItemTest.java
+++ b/tests/src/com/android/launcher3/ui/widget/RequestPinItemTest.java
@@ -169,7 +169,7 @@
}
// Go back to home
- mLauncher.pressHome();
+ mLauncher.goHome();
Wait.atMost("", new ItemSearchCondition(itemMatcher), DEFAULT_ACTIVITY_TIMEOUT,
mLauncher);
}
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
index 1e3b078..8e0eb7b 100644
--- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
+++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
@@ -877,11 +877,22 @@
}
/**
+ * @deprecated use goHome().
* Presses nav bar home button.
*
* @return the Workspace object.
*/
+ @Deprecated
public Workspace pressHome() {
+ return goHome();
+ }
+
+ /**
+ * Presses nav bar home button.
+ *
+ * @return the Workspace object.
+ */
+ public Workspace goHome() {
try (LauncherInstrumentation.Closable e = eventsCheck();
LauncherInstrumentation.Closable c = addContextLayer("want to switch to home")) {
waitForLauncherInitialized();