Merge "Refine way to trigger the keyboard for a controlled insets animation." into main
diff --git a/aconfig/launcher.aconfig b/aconfig/launcher.aconfig
index ace2210..5689c8a 100644
--- a/aconfig/launcher.aconfig
+++ b/aconfig/launcher.aconfig
@@ -55,3 +55,17 @@
description: "Enables launcher to listen to all transitions that include home activity"
bug: "306053414"
}
+
+flag {
+ name: "enable_taskbar_pinning"
+ namespace: "launcher"
+ description: "Enables taskbar pinning to allow user to switch between transient and persistent taskbar flavors."
+ bug: "270396583"
+}
+
+flag {
+ name: "enable_split_from_fullscreen_with_keyboard_shortcuts"
+ namespace: "launcher"
+ description: "Enables initiating split from a fullscreen app using keyboard shortcuts"
+ bug: "270394122"
+}
diff --git a/quickstep/res/layout/overview_actions_container.xml b/quickstep/res/layout/overview_actions_container.xml
index 0fda0bf..fe517fa 100644
--- a/quickstep/res/layout/overview_actions_container.xml
+++ b/quickstep/res/layout/overview_actions_container.xml
@@ -31,7 +31,7 @@
android:layout_height="1dp"
android:layout_weight="1" />
- <Button
+ <com.android.quickstep.views.ScreenshotActionButton
android:id="@+id/action_screenshot"
style="@style/OverviewActionButton"
android:layout_width="wrap_content"
@@ -40,17 +40,12 @@
android:text="@string/action_screenshot"
android:theme="@style/ThemeControlHighlightWorkspaceColor" />
- <Space
- android:id="@+id/action_split_space"
- android:layout_width="@dimen/overview_actions_button_spacing"
- android:layout_height="1dp"
- android:visibility="gone" />
-
- <Button
+ <com.android.quickstep.views.SplitActionButton
android:id="@+id/action_split"
style="@style/OverviewActionButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_marginStart="@dimen/overview_actions_button_spacing"
android:text="@string/action_split"
android:theme="@style/ThemeControlHighlightWorkspaceColor"
android:visibility="gone" />
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
index db1ea42..820b996 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
@@ -31,8 +31,8 @@
import static com.android.launcher3.Utilities.calculateTextHeight;
import static com.android.launcher3.Utilities.isRunningInTestHarness;
import static com.android.launcher3.config.FeatureFlags.ENABLE_TASKBAR_NAVBAR_UNIFICATION;
-import static com.android.launcher3.config.FeatureFlags.ENABLE_TASKBAR_PINNING;
import static com.android.launcher3.config.FeatureFlags.enableTaskbarNoRecreate;
+import static com.android.launcher3.config.FeatureFlags.enableTaskbarPinning;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_FOLDER_OPEN;
import static com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_DRAGGING;
import static com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_FULLSCREEN;
@@ -871,7 +871,7 @@
}
boolean shouldTreatAsTransient = DisplayController.isTransientTaskbar(this)
- || (ENABLE_TASKBAR_PINNING.get() && !isThreeButtonNav());
+ || (enableTaskbarPinning() && !isThreeButtonNav());
int extraHeightForTaskbarTooltips = enableCursorHoverStates()
? resources.getDimensionPixelSize(R.dimen.arrow_toast_arrow_height)
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
index 5be74be..e5c4c96 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
@@ -23,7 +23,7 @@
import static com.android.app.animation.Interpolators.INSTANT;
import static com.android.app.animation.Interpolators.LINEAR;
import static com.android.launcher3.LauncherPrefs.TASKBAR_PINNING;
-import static com.android.launcher3.config.FeatureFlags.ENABLE_TASKBAR_PINNING;
+import static com.android.launcher3.config.FeatureFlags.enableTaskbarPinning;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_LONGPRESS_HIDE;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_LONGPRESS_SHOW;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TRANSIENT_TASKBAR_HIDE;
@@ -333,7 +333,7 @@
// that taskbar unstashes when going to 3 button mode (supportsVisualStashing() false).
boolean isManuallyStashedInApp = supportsVisualStashing()
&& !isTransientTaskbar
- && !ENABLE_TASKBAR_PINNING.get()
+ && !enableTaskbarPinning()
&& mPrefs.getBoolean(SHARED_PREFS_STASHED_KEY, DEFAULT_STASHED_PREF);
boolean isInSetup = !mActivity.isUserSetupComplete() || setupUIVisible;
updateStateForFlag(FLAG_STASHED_IN_APP_MANUAL, isManuallyStashedInApp);
@@ -365,7 +365,7 @@
* Returns whether the user can manually stash the taskbar based on the current device state.
*/
protected boolean supportsManualStashing() {
- if (ENABLE_TASKBAR_PINNING.get() && LauncherPrefs.get(mActivity).get(TASKBAR_PINNING)) {
+ if (enableTaskbarPinning() && LauncherPrefs.get(mActivity).get(TASKBAR_PINNING)) {
return false;
}
return supportsVisualStashing()
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java
index a7461b7..81e4ad5 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java
@@ -20,6 +20,7 @@
import static com.android.launcher3.Flags.enableCursorHoverStates;
import static com.android.launcher3.config.FeatureFlags.ENABLE_ALL_APPS_SEARCH_IN_TASKBAR;
+import static com.android.launcher3.config.FeatureFlags.enableTaskbarPinning;
import static com.android.launcher3.icons.IconNormalizer.ICON_VISIBLE_AREA_FACTOR;
import android.content.Context;
@@ -45,7 +46,6 @@
import com.android.launcher3.Insettable;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.folder.FolderIcon;
import com.android.launcher3.icons.ThemedIconDrawable;
import com.android.launcher3.model.data.FolderInfo;
@@ -128,7 +128,7 @@
int actualMargin = resources.getDimensionPixelSize(R.dimen.taskbar_icon_spacing);
int actualIconSize = mActivityContext.getDeviceProfile().taskbarIconSize;
- if (FeatureFlags.ENABLE_TASKBAR_PINNING.get()) {
+ if (enableTaskbarPinning()) {
DeviceProfile deviceProfile = mActivityContext.getTransientTaskbarDeviceProfile();
actualIconSize = deviceProfile.taskbarIconSize;
}
@@ -155,12 +155,11 @@
.inflate(R.layout.taskbar_all_apps_button, this, false);
mAllAppsButton.setIconDrawable(resources.getDrawable(
getAllAppsButton(isTransientTaskbar)));
- mAllAppsButton.setScaleX(mIsRtl ? -1 : 1);
mAllAppsButton.setPadding(mItemPadding, mItemPadding, mItemPadding, mItemPadding);
mAllAppsButton.setForegroundTint(
mActivityContext.getColor(R.color.all_apps_button_color));
- if (FeatureFlags.ENABLE_TASKBAR_PINNING.get()) {
+ if (enableTaskbarPinning()) {
mTaskbarDivider = (IconButtonView) LayoutInflater.from(context).inflate(
R.layout.taskbar_divider,
this, false);
@@ -177,7 +176,7 @@
@DrawableRes
private int getAllAppsButton(boolean isTransientTaskbar) {
boolean shouldSelectTransientIcon =
- (isTransientTaskbar || FeatureFlags.ENABLE_TASKBAR_PINNING.get())
+ (isTransientTaskbar || enableTaskbarPinning())
&& !mActivityContext.isThreeButtonNav();
if (ENABLE_ALL_APPS_SEARCH_IN_TASKBAR.get()) {
return shouldSelectTransientIcon
@@ -546,7 +545,7 @@
int iconLayoutBoundsWidth =
countExcludingQsb * (mItemMarginLeftRight * 2 + mIconTouchSize);
- if (FeatureFlags.ENABLE_TASKBAR_PINNING.get() && countExcludingQsb > 1) {
+ if (enableTaskbarPinning() && countExcludingQsb > 1) {
// We are removing 4 * mItemMarginLeftRight as there should be no space between
// All Apps icon, divider icon, and first app icon in taskbar
iconLayoutBoundsWidth -= mItemMarginLeftRight * 4;
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
index 8f43a2f..0225de4 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
@@ -26,7 +26,7 @@
import static com.android.launcher3.anim.AnimatedFloat.VALUE;
import static com.android.launcher3.anim.AnimatorListeners.forEndCallback;
import static com.android.launcher3.config.FeatureFlags.ENABLE_TASKBAR_NAVBAR_UNIFICATION;
-import static com.android.launcher3.config.FeatureFlags.ENABLE_TASKBAR_PINNING;
+import static com.android.launcher3.config.FeatureFlags.enableTaskbarPinning;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_ALLAPPS_BUTTON_TAP;
import static com.android.launcher3.taskbar.TaskbarPinningController.PINNING_PERSISTENT;
import static com.android.launcher3.taskbar.TaskbarPinningController.PINNING_TRANSIENT;
@@ -221,7 +221,7 @@
mTaskbarIconAlpha.get(ALPHA_INDEX_SMALL_SCREEN)
.animateToValue(isPhoneButtonNavMode(mActivity) ? 0 : 1).start();
}
- if (ENABLE_TASKBAR_PINNING.get()) {
+ if (enableTaskbarPinning()) {
mTaskbarView.addOnLayoutChangeListener(mTaskbarViewLayoutChangeListener);
}
}
@@ -234,7 +234,7 @@
}
public void onDestroy() {
- if (ENABLE_TASKBAR_PINNING.get()) {
+ if (enableTaskbarPinning()) {
mTaskbarView.removeOnLayoutChangeListener(mTaskbarViewLayoutChangeListener);
}
LauncherAppState.getInstance(mActivity).getModel().removeCallbacks(mModelCallbacks);
@@ -367,6 +367,10 @@
float allAppIconTranslateRange = mapRange(scale, transientTaskbarAllAppsOffset,
persistentTaskbarAllAppsOffset);
+ if (mIsRtl) {
+ allAppIconTranslateRange *= -1;
+ }
+
float halfIconCount = iconViews.length / 2.0f;
for (int iconIndex = 0; iconIndex < iconViews.length; iconIndex++) {
View iconView = iconViews[iconIndex];
@@ -672,7 +676,7 @@
// to avoid icons disappearing rather than fading out visually.
setter.setViewAlpha(child, 0, Interpolators.clampToProgress(LINEAR, 0.8f, 1f));
} else if ((isAllAppsButton && !FeatureFlags.ENABLE_ALL_APPS_BUTTON_IN_HOTSEAT.get())
- || (isTaskbarDividerView && ENABLE_TASKBAR_PINNING.get())) {
+ || (isTaskbarDividerView && enableTaskbarPinning())) {
if (!isToHome
&& mIsHotseatIconOnTopWhenAligned
&& mIsStashed) {
diff --git a/quickstep/src/com/android/quickstep/util/SplitToWorkspaceController.java b/quickstep/src/com/android/quickstep/util/SplitToWorkspaceController.java
index 3748a24..bdbdfd8 100644
--- a/quickstep/src/com/android/quickstep/util/SplitToWorkspaceController.java
+++ b/quickstep/src/com/android/quickstep/util/SplitToWorkspaceController.java
@@ -16,7 +16,7 @@
package com.android.quickstep.util;
-import static com.android.launcher3.config.FeatureFlags.ENABLE_SPLIT_FROM_FULLSCREEN_WITH_KEYBOARD_SHORTCUTS;
+import static com.android.launcher3.config.FeatureFlags.enableSplitFromFullscreenWithKeyboardShortcuts;
import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;
import static com.android.quickstep.views.DesktopTaskView.isDesktopModeSupported;
@@ -191,7 +191,7 @@
}
private boolean shouldIgnoreSecondSplitLaunch() {
- return (!ENABLE_SPLIT_FROM_FULLSCREEN_WITH_KEYBOARD_SHORTCUTS.get()
+ return (!enableSplitFromFullscreenWithKeyboardShortcuts()
&& !FeatureFlags.enableSplitContextually()
&& !isDesktopModeSupported())
|| !mController.isSplitSelectActive();
diff --git a/quickstep/src/com/android/quickstep/util/SplitWithKeyboardShortcutController.java b/quickstep/src/com/android/quickstep/util/SplitWithKeyboardShortcutController.java
index f3fa86a..8f719d0 100644
--- a/quickstep/src/com/android/quickstep/util/SplitWithKeyboardShortcutController.java
+++ b/quickstep/src/com/android/quickstep/util/SplitWithKeyboardShortcutController.java
@@ -16,7 +16,7 @@
package com.android.quickstep.util;
-import static com.android.launcher3.config.FeatureFlags.ENABLE_SPLIT_FROM_FULLSCREEN_WITH_KEYBOARD_SHORTCUTS;
+import static com.android.launcher3.config.FeatureFlags.enableSplitFromFullscreenWithKeyboardShortcuts;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_KEYBOARD_SHORTCUT_SPLIT_LEFT_TOP;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_KEYBOARD_SHORTCUT_SPLIT_RIGHT_BOTTOM;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
@@ -75,7 +75,7 @@
@BinderThread
public void enterStageSplit(boolean leftOrTop) {
- if (!ENABLE_SPLIT_FROM_FULLSCREEN_WITH_KEYBOARD_SHORTCUTS.get()) {
+ if (!enableSplitFromFullscreenWithKeyboardShortcuts()) {
return;
}
RecentsAnimationCallbacks callbacks = new RecentsAnimationCallbacks(
diff --git a/quickstep/src/com/android/quickstep/views/ActionButton.kt b/quickstep/src/com/android/quickstep/views/ActionButton.kt
new file mode 100644
index 0000000..5c004cc
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/views/ActionButton.kt
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2023 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.quickstep.views
+
+import android.content.Context
+import android.util.AttributeSet
+import android.widget.Button
+
+/**
+ * A button on the Overview Actions Bar. Custom logic for hiding/showing each button type is handled
+ * in the respective subclass.
+ */
+open class ActionButton : Button {
+ private var mHiddenFlags = 0
+
+ constructor(context: Context) : super(context)
+ constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
+ constructor(
+ context: Context,
+ attrs: AttributeSet?,
+ defStyleAttr: Int
+ ) : super(context, attrs, defStyleAttr)
+
+ /**
+ * Updates the proper flags to indicate whether the button should be hidden.
+ *
+ * @param flag The flag to update.
+ * @param enable Whether to enable the hidden flag: True will cause view to be hidden.
+ */
+ protected fun updateHiddenFlags(flag: Int, enable: Boolean) {
+ if (enable) {
+ mHiddenFlags = mHiddenFlags or flag
+ } else {
+ mHiddenFlags = mHiddenFlags and flag.inv()
+ }
+ val shouldBeVisible = mHiddenFlags == 0
+ this.visibility = if (shouldBeVisible) VISIBLE else GONE
+ }
+
+ /** Show/hide the button when the focused task is a single/pair. */
+ open fun updateForMultipleTasks(hasMultipleTasks: Boolean) {
+ // overridden in subclass, or else don't do anything
+ }
+
+ /** Show/hide the button depending on if the device is a tablet. */
+ open fun updateForTablet(isTablet: Boolean) {
+ // overridden in subclass, or else don't do anything
+ }
+}
diff --git a/quickstep/src/com/android/quickstep/views/OverviewActionsView.java b/quickstep/src/com/android/quickstep/views/OverviewActionsView.java
index 7f1d619..8692e4e 100644
--- a/quickstep/src/com/android/quickstep/views/OverviewActionsView.java
+++ b/quickstep/src/com/android/quickstep/views/OverviewActionsView.java
@@ -22,7 +22,6 @@
import android.util.AttributeSet;
import android.view.View;
import android.view.View.OnClickListener;
-import android.widget.Button;
import android.widget.FrameLayout;
import androidx.annotation.IntDef;
@@ -41,6 +40,8 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
+import java.util.ArrayList;
+import java.util.List;
/**
* View for showing action buttons in Overview
@@ -89,14 +90,11 @@
private static final int INDEX_SCROLL_ALPHA = 5;
private static final int NUM_ALPHAS = 6;
- public @interface SplitButtonHiddenFlags { }
- public static final int FLAG_IS_NOT_TABLET = 1 << 0;
-
- public @interface SplitButtonDisabledFlags { }
- public static final int FLAG_SINGLE_TASK = 1 << 0;
-
private MultiValueAlpha mMultiValueAlpha;
- private Button mSplitButton;
+
+ private List<ActionButton> mActionButtons = new ArrayList<>();
+ private ScreenshotActionButton mScreenshotButton;
+ private SplitActionButton mSplitButton;
@ActionsHiddenFlags
private int mHiddenFlags;
@@ -104,12 +102,6 @@
@ActionsDisabledFlags
protected int mDisabledFlags;
- @SplitButtonHiddenFlags
- private int mSplitButtonHiddenFlags;
-
- @SplitButtonDisabledFlags
- private int mSplitButtonDisabledFlags;
-
@Nullable
protected T mCallbacks;
@@ -135,9 +127,12 @@
mMultiValueAlpha = new MultiValueAlpha(findViewById(R.id.action_buttons), NUM_ALPHAS);
mMultiValueAlpha.setUpdateVisibility(true);
- findViewById(R.id.action_screenshot).setOnClickListener(this);
+ mScreenshotButton = findViewById(R.id.action_screenshot);
+ mScreenshotButton.setOnClickListener(this);
+ mActionButtons.add(mScreenshotButton);
mSplitButton = findViewById(R.id.action_split);
mSplitButton.setOnClickListener(this);
+ mActionButtons.add(mSplitButton);
}
/**
@@ -201,40 +196,28 @@
}
boolean isEnabled = (mDisabledFlags & ~DISABLED_ROTATED) == 0;
LayoutUtils.setViewEnabled(this, isEnabled);
- updateSplitButtonEnabledState();
}
/**
- * Updates the proper flags to indicate whether the "Split screen" button should be hidden.
- *
- * @param flag The flag to update.
- * @param enable Whether to enable the hidden flag: True will cause view to be hidden.
+ * Updates flags to hide and show actions buttons when a grouped task (split screen) is focused.
+ * @param isGroupedTask True if the focused task is a grouped task.
*/
- public void updateSplitButtonHiddenFlags(@SplitButtonHiddenFlags int flag, boolean enable) {
- if (enable) {
- mSplitButtonHiddenFlags |= flag;
- } else {
- mSplitButtonHiddenFlags &= ~flag;
+ public void updateForGroupedTask(boolean isGroupedTask) {
+ for (ActionButton button : mActionButtons) {
+ // Update flags to show/hide buttons.
+ button.updateForMultipleTasks(isGroupedTask);
}
- if (mSplitButton == null) return;
- boolean shouldBeVisible = mSplitButtonHiddenFlags == 0;
- mSplitButton.setVisibility(shouldBeVisible ? VISIBLE : GONE);
- findViewById(R.id.action_split_space).setVisibility(shouldBeVisible ? VISIBLE : GONE);
}
/**
- * Updates the proper flags to indicate whether the "Split screen" button should be disabled.
- *
- * @param flag The flag to update.
- * @param enable Whether to enable the disable flag: True will cause view to be disabled.
+ * Updates flags to hide and show actions buttons depending on if the device is a tablet.
+ * @param isTablet True if the current device is a tablet.
*/
- public void updateSplitButtonDisabledFlags(@SplitButtonDisabledFlags int flag, boolean enable) {
- if (enable) {
- mSplitButtonDisabledFlags |= flag;
- } else {
- mSplitButtonDisabledFlags &= ~flag;
+ public void updateForTablet(boolean isTablet) {
+ for (ActionButton button : mActionButtons) {
+ // Update flags to show/hide buttons.
+ button.updateForTablet(isTablet);
}
- updateSplitButtonEnabledState();
}
public MultiProperty getContentAlpha() {
@@ -312,18 +295,4 @@
(dp.isLandscape ? R.drawable.ic_split_horizontal : R.drawable.ic_split_vertical),
0, 0, 0);
}
-
- /**
- * Enables/disables the "Split" button based on the status of mSplitButtonDisabledFlags and
- * mDisabledFlags.
- */
- private void updateSplitButtonEnabledState() {
- if (mSplitButton == null) {
- return;
- }
- boolean isParentEnabled = (mDisabledFlags & ~DISABLED_ROTATED) == 0;
- boolean shouldBeEnabled = mSplitButtonDisabledFlags == 0 && isParentEnabled;
- mSplitButton.setEnabled(shouldBeEnabled);
- }
-
}
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index 7972999..6a275e6 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -20,7 +20,6 @@
import static android.view.Surface.ROTATION_0;
import static android.view.View.MeasureSpec.EXACTLY;
import static android.view.View.MeasureSpec.makeMeasureSpec;
-
import static com.android.app.animation.Interpolators.ACCELERATE;
import static com.android.app.animation.Interpolators.ACCELERATE_0_75;
import static com.android.app.animation.Interpolators.ACCELERATE_DECELERATE;
@@ -34,6 +33,7 @@
import static com.android.launcher3.AbstractFloatingView.TYPE_TASK_MENU;
import static com.android.launcher3.AbstractFloatingView.getTopOpenViewWithType;
import static com.android.launcher3.BaseActivity.STATE_HANDLER_INVISIBILITY_FLAGS;
+import static com.android.launcher3.Flags.enableGridOnlyOverview;
import static com.android.launcher3.LauncherAnimUtils.SUCCESS_TRANSITION_PROGRESS;
import static com.android.launcher3.LauncherAnimUtils.VIEW_ALPHA;
import static com.android.launcher3.LauncherState.BACKGROUND_APP;
@@ -42,7 +42,6 @@
import static com.android.launcher3.Utilities.mapToRange;
import static com.android.launcher3.Utilities.squaredHypot;
import static com.android.launcher3.Utilities.squaredTouchSlop;
-import static com.android.launcher3.Flags.enableGridOnlyOverview;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_OVERVIEW_ACTIONS_SPLIT;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_CLEAR_ALL;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_DISMISS_SWIPE_UP;
@@ -57,8 +56,6 @@
import static com.android.quickstep.util.LogUtils.splitFailureMessage;
import static com.android.quickstep.views.ClearAllButton.DISMISS_ALPHA;
import static com.android.quickstep.views.DesktopTaskView.isDesktopModeSupported;
-import static com.android.quickstep.views.OverviewActionsView.FLAG_IS_NOT_TABLET;
-import static com.android.quickstep.views.OverviewActionsView.FLAG_SINGLE_TASK;
import static com.android.quickstep.views.OverviewActionsView.HIDDEN_ACTIONS_IN_MENU;
import static com.android.quickstep.views.OverviewActionsView.HIDDEN_DESKTOP;
import static com.android.quickstep.views.OverviewActionsView.HIDDEN_NON_ZERO_ROTATION;
@@ -3927,18 +3924,23 @@
}
/**
- * Hides all overview actions if current page is for split apps, shows otherwise
- * If actions are showing, we only show split option if
+ * Hides all overview actions if user is halfway through split selection, shows otherwise.
+ * We only show split option if:
+ * * Focused view is a single app
* * Device is large screen
- * * There are at least 2 tasks to invoke split
*/
private void updateCurrentTaskActionsVisibility() {
- boolean isCurrentSplit = getCurrentPageTaskView() instanceof GroupedTaskView;
- mActionsView.updateHiddenFlags(HIDDEN_SPLIT_SCREEN, isCurrentSplit);
+ boolean isGroupedTask = getCurrentPageTaskView() != null
+ && getCurrentPageTaskView().containsMultipleTasks();
+ // Update flags to see if entire actions bar should be hidden.
+ mActionsView.updateHiddenFlags(HIDDEN_SPLIT_SCREEN, isGroupedTask);
mActionsView.updateHiddenFlags(HIDDEN_SPLIT_SELECT_ACTIVE, isSplitSelectionActive());
- mActionsView.updateSplitButtonHiddenFlags(FLAG_IS_NOT_TABLET,
- !mActivity.getDeviceProfile().isTablet);
- mActionsView.updateSplitButtonDisabledFlags(FLAG_SINGLE_TASK, /*enable=*/ false);
+ // Update flags to see if actions bar should show buttons for a single task or a pair of
+ // tasks.
+ mActionsView.updateForGroupedTask(isGroupedTask);
+ // Update flags to see if split button should be hidden.
+ mActionsView.updateForTablet(mActivity.getDeviceProfile().isTablet);
+
if (isDesktopModeSupported()) {
boolean isCurrentDesktop = getCurrentPageTaskView() instanceof DesktopTaskView;
mActionsView.updateHiddenFlags(HIDDEN_DESKTOP, isCurrentDesktop);
diff --git a/quickstep/src/com/android/quickstep/views/ScreenshotActionButton.kt b/quickstep/src/com/android/quickstep/views/ScreenshotActionButton.kt
new file mode 100644
index 0000000..9cb48b8
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/views/ScreenshotActionButton.kt
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2023 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.quickstep.views
+
+import android.content.Context
+import android.util.AttributeSet
+
+/** A button on the Overview Actions Bar for screenshotting the focused app. */
+class ScreenshotActionButton : ActionButton {
+ companion object {
+ const val FLAG_MULTIPLE_TASKS_HIDE_SCREENSHOT = 1 shl 0
+ }
+
+ constructor(context: Context) : super(context)
+ constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
+ constructor(
+ context: Context,
+ attrs: AttributeSet?,
+ defStyleAttr: Int
+ ) : super(context, attrs, defStyleAttr)
+
+ /** Show/hide the button when the focused task is a single/pair. */
+ override fun updateForMultipleTasks(hasMultipleTasks: Boolean) {
+ // Hidden for multiple tasks
+ updateHiddenFlags(FLAG_MULTIPLE_TASKS_HIDE_SCREENSHOT, hasMultipleTasks)
+ }
+}
diff --git a/quickstep/src/com/android/quickstep/views/SplitActionButton.kt b/quickstep/src/com/android/quickstep/views/SplitActionButton.kt
new file mode 100644
index 0000000..88d1a77
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/views/SplitActionButton.kt
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2023 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.quickstep.views
+
+import android.content.Context
+import android.util.AttributeSet
+
+/** A button on the Overview Actions Bar for initiating split screen. */
+class SplitActionButton : ActionButton {
+ companion object {
+ const val FLAG_IS_NOT_TABLET_HIDE_SPLIT = 1 shl 0
+ const val FLAG_MULTIPLE_TASKS_HIDE_SPLIT = 1 shl 1
+ }
+
+ constructor(context: Context) : super(context)
+ constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
+ constructor(
+ context: Context,
+ attrs: AttributeSet?,
+ defStyleAttr: Int
+ ) : super(context, attrs, defStyleAttr)
+
+ /** Show/hide the button when the focused task is a single/pair. */
+ override fun updateForMultipleTasks(hasMultipleTasks: Boolean) {
+ // Hidden for multiple tasks
+ updateHiddenFlags(FLAG_MULTIPLE_TASKS_HIDE_SPLIT, hasMultipleTasks)
+ }
+
+ /** Show/hide the button depending on if the device is a tablet. */
+ override fun updateForTablet(isTablet: Boolean) {
+ // Hidden for non-tablets
+ updateHiddenFlags(FLAG_IS_NOT_TABLET_HIDE_SPLIT, !isTablet)
+ }
+}
diff --git a/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java b/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java
index 281516c..17fa253 100644
--- a/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java
+++ b/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java
@@ -162,7 +162,6 @@
@Before
public void setUp() {
mLauncher.onTestStart();
- AbstractLauncherUiTest.waitForSetupWizardDismissal();
AbstractLauncherUiTest.onTestStart();
}
diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
index 0966350..ff8537b 100644
--- a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
+++ b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
@@ -103,7 +103,6 @@
@Test
@NavigationModeSwitch
@PortraitLandscape
- @PlatinumTest(focusArea = "launcher")
public void testWorkspaceSwitchToAllApps() {
assertNotNull("switchToAllApps() returned null",
mLauncher.getWorkspace().switchToAllApps());
@@ -180,7 +179,6 @@
@Test
@NavigationModeSwitch
@PortraitLandscape
- @PlatinumTest(focusArea = "launcher")
public void testOverviewActions() throws Exception {
assumeFalse("Skipping Overview Actions tests for grid only overview",
mLauncher.isTablet() && mLauncher.isGridOnlyOverviewEnabled());
@@ -217,7 +215,6 @@
@NavigationModeSwitch
@PortraitLandscape
@ScreenRecord // b/238461765
- @PlatinumTest(focusArea = "launcher")
public void testSwitchToOverview() throws Exception {
startTestAppsWithCheck();
assertNotNull("Workspace.switchToOverview() returned null",
@@ -243,7 +240,6 @@
@Test
@NavigationModeSwitch
@PortraitLandscape
- @PlatinumTest(focusArea = "launcher")
public void testBackground() throws Exception {
startAppFast(CALCULATOR_APP_PACKAGE);
final LaunchedAppState launchedAppState = getAndAssertLaunchedApp();
@@ -270,7 +266,6 @@
@Test
@NavigationModeSwitch
@PortraitLandscape
- @PlatinumTest(focusArea = "launcher")
public void testQuickSwitchFromApp() throws Exception {
startTestActivity(2);
startTestActivity(3);
@@ -300,7 +295,6 @@
@Test
@ScreenRecord // b/242163205
- @PlatinumTest(focusArea = "launcher")
@TaskbarModeSwitch(mode = PERSISTENT)
public void testQuickSwitchToPreviousAppForTablet() throws Exception {
assumeTrue(mLauncher.isTablet());
@@ -327,7 +321,6 @@
@Test
@NavigationModeSwitch
@PortraitLandscape
- @PlatinumTest(focusArea = "launcher")
public void testQuickSwitchFromHome() throws Exception {
startTestActivity(2);
mLauncher.goHome().quickSwitchToPreviousApp();
diff --git a/res/values/attrs.xml b/res/values/attrs.xml
index 1a960f5..3682830 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.xml
@@ -261,7 +261,7 @@
<!-- Responsive grids attributes -->
<declare-styleable name="ResponsiveSpec">
- <attr name="specType" format="integer">
+ <attr name="dimensionType" format="integer">
<enum name="height" value="0" />
<enum name="width" value="1" />
</attr>
@@ -273,22 +273,22 @@
</declare-styleable>
<declare-styleable name="WorkspaceSpec">
- <attr name="specType" />
+ <attr name="dimensionType" />
<attr name="maxAvailableSize" />
</declare-styleable>
<declare-styleable name="FolderSpec">
- <attr name="specType" />
+ <attr name="dimensionType" />
<attr name="maxAvailableSize" />
</declare-styleable>
<declare-styleable name="AllAppsSpec">
- <attr name="specType" />
+ <attr name="dimensionType" />
<attr name="maxAvailableSize" />
</declare-styleable>
<declare-styleable name="HotseatSpec">
- <attr name="specType" />
+ <attr name="dimensionType" />
<attr name="maxAvailableSize" />
</declare-styleable>
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index a8266ec..fed031b 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -118,10 +118,10 @@
// Responsive grid
private final boolean mIsResponsiveGrid;
- private CalculatedResponsiveSpec mResponsiveWidthSpec;
- private CalculatedResponsiveSpec mResponsiveHeightSpec;
- private CalculatedResponsiveSpec mAllAppsResponsiveWidthSpec;
- private CalculatedResponsiveSpec mAllAppsResponsiveHeightSpec;
+ private CalculatedResponsiveSpec mResponsiveWorkspaceWidthSpec;
+ private CalculatedResponsiveSpec mResponsiveWorkspaceHeightSpec;
+ private CalculatedResponsiveSpec mResponsiveAllAppsWidthSpec;
+ private CalculatedResponsiveSpec mResponsiveAllAppsHeightSpec;
private CalculatedResponsiveSpec mResponsiveFolderWidthSpec;
private CalculatedResponsiveSpec mResponsiveFolderHeightSpec;
private CalculatedHotseatSpec mResponsiveHotseatSpec;
@@ -602,21 +602,21 @@
new ResourceHelper(context,
isTwoPanels ? inv.workspaceSpecsTwoPanelId : inv.workspaceSpecsId),
ResponsiveSpecType.Workspace);
- mResponsiveWidthSpec = workspaceSpecs.getCalculatedSpec(responsiveAspectRatio,
+ mResponsiveWorkspaceWidthSpec = workspaceSpecs.getCalculatedSpec(responsiveAspectRatio,
DimensionType.WIDTH, numWorkspaceColumns, availableResponsiveWidth);
- mResponsiveHeightSpec = workspaceSpecs.getCalculatedSpec(responsiveAspectRatio,
+ mResponsiveWorkspaceHeightSpec = workspaceSpecs.getCalculatedSpec(responsiveAspectRatio,
DimensionType.HEIGHT, inv.numRows, availableResponsiveHeight);
ResponsiveSpecsProvider allAppsSpecs = ResponsiveSpecsProvider.create(
new ResourceHelper(context,
isTwoPanels ? inv.allAppsSpecsTwoPanelId : inv.allAppsSpecsId),
ResponsiveSpecType.AllApps);
- mAllAppsResponsiveWidthSpec = allAppsSpecs.getCalculatedSpec(responsiveAspectRatio,
+ mResponsiveAllAppsWidthSpec = allAppsSpecs.getCalculatedSpec(responsiveAspectRatio,
DimensionType.WIDTH, numAllAppsColumns, availableWidthPx,
- mResponsiveWidthSpec);
- mAllAppsResponsiveHeightSpec = allAppsSpecs.getCalculatedSpec(responsiveAspectRatio,
+ mResponsiveWorkspaceWidthSpec);
+ mResponsiveAllAppsHeightSpec = allAppsSpecs.getCalculatedSpec(responsiveAspectRatio,
DimensionType.HEIGHT, inv.numRows, heightPx - mInsets.top,
- mResponsiveHeightSpec);
+ mResponsiveWorkspaceHeightSpec);
ResponsiveSpecsProvider folderSpecs = ResponsiveSpecsProvider.create(
new ResourceHelper(context,
@@ -624,12 +624,12 @@
ResponsiveSpecType.Folder);
mResponsiveFolderWidthSpec = folderSpecs.getCalculatedSpec(responsiveAspectRatio,
DimensionType.WIDTH, inv.numFolderColumns,
- mResponsiveWidthSpec.getAvailableSpace(),
- mResponsiveWidthSpec);
+ mResponsiveWorkspaceWidthSpec.getAvailableSpace(),
+ mResponsiveWorkspaceWidthSpec);
mResponsiveFolderHeightSpec = folderSpecs.getCalculatedSpec(responsiveAspectRatio,
DimensionType.HEIGHT, inv.numFolderRows,
- mResponsiveHeightSpec.getAvailableSpace(),
- mResponsiveHeightSpec);
+ mResponsiveWorkspaceHeightSpec.getAvailableSpace(),
+ mResponsiveWorkspaceHeightSpec);
}
desiredWorkspaceHorizontalMarginPx = getHorizontalMarginPx(inv, res);
@@ -759,7 +759,7 @@
private int getHorizontalMarginPx(InvariantDeviceProfile idp, Resources res) {
if (mIsResponsiveGrid) {
- return mResponsiveWidthSpec.getStartPaddingPx();
+ return mResponsiveWorkspaceWidthSpec.getStartPaddingPx();
}
if (isVerticalBarLayout()) {
@@ -775,8 +775,8 @@
InvariantDeviceProfile inv,
int extraSpace) {
if (mIsResponsiveGrid) {
- workspaceTopPadding = mResponsiveHeightSpec.getStartPaddingPx();
- workspaceBottomPadding = mResponsiveHeightSpec.getEndPaddingPx();
+ workspaceTopPadding = mResponsiveWorkspaceHeightSpec.getStartPaddingPx();
+ workspaceBottomPadding = mResponsiveWorkspaceHeightSpec.getEndPaddingPx();
} else if (mIsScalableGrid && inv.devicePaddingId != INVALID_RESOURCE_HANDLE) {
// Paddings were created assuming no scaling, so we first unscale the extra space.
int unscaledExtraSpace = (int) (extraSpace / cellScaleToFit);
@@ -872,8 +872,8 @@
int verticalSpacePx = 0;
if (mIsResponsiveGrid) {
- horizontalSpacePx = mResponsiveWidthSpec.getGutterPx();
- verticalSpacePx = mResponsiveHeightSpec.getGutterPx();
+ horizontalSpacePx = mResponsiveWorkspaceWidthSpec.getGutterPx();
+ verticalSpacePx = mResponsiveWorkspaceHeightSpec.getGutterPx();
} else if (mIsScalableGrid) {
horizontalSpacePx = pxFromDp(idp.borderSpaces[mTypeIndex].x, mMetrics, scale);
verticalSpacePx = pxFromDp(idp.borderSpaces[mTypeIndex].y, mMetrics, scale);
@@ -1060,8 +1060,8 @@
cellLayoutBorderSpacePx = getCellLayoutBorderSpace(inv, scale);
if (mIsResponsiveGrid) {
- cellWidthPx = mResponsiveWidthSpec.getCellSizePx();
- cellHeightPx = mResponsiveHeightSpec.getCellSizePx();
+ cellWidthPx = mResponsiveWorkspaceWidthSpec.getCellSizePx();
+ cellHeightPx = mResponsiveWorkspaceHeightSpec.getCellSizePx();
if (cellWidthPx < iconSizePx) {
// get a smaller icon size
@@ -1266,24 +1266,24 @@
private void updateAllAppsWithResponsiveMeasures(Resources res) {
allAppsBorderSpacePx = new Point(
- mAllAppsResponsiveWidthSpec.getGutterPx(),
- mAllAppsResponsiveHeightSpec.getGutterPx()
+ mResponsiveAllAppsWidthSpec.getGutterPx(),
+ mResponsiveAllAppsHeightSpec.getGutterPx()
);
- allAppsCellHeightPx = mAllAppsResponsiveHeightSpec.getCellSizePx()
- + mAllAppsResponsiveHeightSpec.getGutterPx();
- allAppsCellWidthPx = mAllAppsResponsiveWidthSpec.getCellSizePx();
+ allAppsCellHeightPx = mResponsiveAllAppsHeightSpec.getCellSizePx()
+ + mResponsiveAllAppsHeightSpec.getGutterPx();
+ allAppsCellWidthPx = mResponsiveAllAppsWidthSpec.getCellSizePx();
// This workaround is needed to align AllApps icons with Workspace icons
// since AllApps doesn't have borders between cells
int halfBorder = allAppsBorderSpacePx.x / 2;
- allAppsPadding.left = mAllAppsResponsiveWidthSpec.getStartPaddingPx() - halfBorder;
- allAppsPadding.right = mAllAppsResponsiveWidthSpec.getEndPaddingPx() - halfBorder;
+ allAppsPadding.left = mResponsiveAllAppsWidthSpec.getStartPaddingPx() - halfBorder;
+ allAppsPadding.right = mResponsiveAllAppsWidthSpec.getEndPaddingPx() - halfBorder;
// TODO(b/287975993): Remove this after icon size is extracted to responsive grid
// Copy icon size from the workspace when spec is matchWorkspace or
// use the default all apps icon size
- if (mAllAppsResponsiveHeightSpec.isCellSizeMatchWorkspace()
- || mAllAppsResponsiveWidthSpec.isCellSizeMatchWorkspace()) {
+ if (mResponsiveAllAppsHeightSpec.isCellSizeMatchWorkspace()
+ || mResponsiveAllAppsWidthSpec.isCellSizeMatchWorkspace()) {
allAppsIconSizePx = iconSizePx;
allAppsIconTextSizePx = iconTextSizePx;
allAppsIconDrawablePaddingPx = iconDrawablePaddingPx;
@@ -1588,15 +1588,17 @@
Rect padding = workspacePadding;
if (isVerticalBarLayout()) {
if (mIsResponsiveGrid) {
- padding.top = mResponsiveHeightSpec.getStartPaddingPx();
+ padding.top = mResponsiveWorkspaceHeightSpec.getStartPaddingPx();
padding.bottom = Math.max(0,
- mResponsiveHeightSpec.getEndPaddingPx() - mInsets.bottom);
+ mResponsiveWorkspaceHeightSpec.getEndPaddingPx() - mInsets.bottom);
if (isSeascape()) {
- padding.left = hotseatBarSizePx + mResponsiveWidthSpec.getEndPaddingPx();
- padding.right = mResponsiveWidthSpec.getStartPaddingPx();
+ padding.left =
+ hotseatBarSizePx + mResponsiveWorkspaceWidthSpec.getEndPaddingPx();
+ padding.right = mResponsiveWorkspaceWidthSpec.getStartPaddingPx();
} else {
- padding.left = mResponsiveWidthSpec.getStartPaddingPx();
- padding.right = hotseatBarSizePx + mResponsiveWidthSpec.getEndPaddingPx();
+ padding.left = mResponsiveWorkspaceWidthSpec.getStartPaddingPx();
+ padding.right =
+ hotseatBarSizePx + mResponsiveWorkspaceWidthSpec.getEndPaddingPx();
}
} else {
padding.top = 0;
@@ -2118,12 +2120,14 @@
writer.println(prefix + pxToDpStr("getCellLayoutHeight()", getCellLayoutHeight()));
writer.println(prefix + pxToDpStr("getCellLayoutWidth()", getCellLayoutWidth()));
if (mIsResponsiveGrid) {
- writer.println(prefix + "\tmResponsiveHeightSpec:" + mResponsiveHeightSpec.toString());
- writer.println(prefix + "\tmResponsiveWidthSpec:" + mResponsiveWidthSpec.toString());
- writer.println(prefix + "\tmAllAppsResponsiveHeightSpec:"
- + mAllAppsResponsiveHeightSpec.toString());
- writer.println(prefix + "\tmAllAppsResponsiveWidthSpec:"
- + mAllAppsResponsiveWidthSpec.toString());
+ writer.println(prefix + "\tmResponsiveWorkspaceHeightSpec:"
+ + mResponsiveWorkspaceHeightSpec.toString());
+ writer.println(prefix + "\tmResponsiveWorkspaceWidthSpec:"
+ + mResponsiveWorkspaceWidthSpec.toString());
+ writer.println(prefix + "\tmResponsiveAllAppsHeightSpec:"
+ + mResponsiveAllAppsHeightSpec.toString());
+ writer.println(prefix + "\tmResponsiveAllAppsWidthSpec:"
+ + mResponsiveAllAppsWidthSpec.toString());
writer.println(prefix + "\tmResponsiveFolderHeightSpec:" + mResponsiveFolderHeightSpec);
writer.println(prefix + "\tmResponsiveFolderWidthSpec:" + mResponsiveFolderWidthSpec);
writer.println(prefix + "\tmResponsiveHotseatSpec:" + mResponsiveHotseatSpec);
diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java
index 1c52a2f..51eb363 100644
--- a/src/com/android/launcher3/config/FeatureFlags.java
+++ b/src/com/android/launcher3/config/FeatureFlags.java
@@ -287,11 +287,16 @@
"Enables haptic hint when long pressing on the bottom bar nav handle.");
// TODO(Block 17): Clean up flags
- public static final BooleanFlag ENABLE_TASKBAR_PINNING = getDebugFlag(270396583,
+ // Aconfig migration complete for ENABLE_TASKBAR_PINNING.
+ private static final BooleanFlag ENABLE_TASKBAR_PINNING = getDebugFlag(270396583,
"ENABLE_TASKBAR_PINNING", TEAMFOOD,
"Enables taskbar pinning to allow user to switch between transient and persistent "
+ "taskbar flavors");
+ public static boolean enableTaskbarPinning() {
+ return ENABLE_TASKBAR_PINNING.get() || Flags.enableTaskbarPinning();
+ }
+
public static final BooleanFlag MOVE_STARTUP_DATA_TO_DEVICE_PROTECTED_STORAGE = getDebugFlag(
251502424, "ENABLE_BOOT_AWARE_STARTUP_DATA", DISABLED,
"Marks LauncherPref data as (and allows it to) available while the device is"
@@ -403,11 +408,16 @@
"USE_LOCAL_ICON_OVERRIDES", ENABLED,
"Use inbuilt monochrome icons if app doesn't provide one");
- // TODO(Block 28): Clean up flags
+ // Aconfig migration complete for ENABLE_SPLIT_FROM_FULLSCREEN_WITH_KEYBOARD_SHORTCUTS.
public static final BooleanFlag ENABLE_SPLIT_FROM_FULLSCREEN_WITH_KEYBOARD_SHORTCUTS =
getDebugFlag(270394122, "ENABLE_SPLIT_FROM_FULLSCREEN_SHORTCUT", DISABLED,
"Enable splitting from fullscreen app with keyboard shortcuts");
+ public static boolean enableSplitFromFullscreenWithKeyboardShortcuts() {
+ return ENABLE_SPLIT_FROM_FULLSCREEN_WITH_KEYBOARD_SHORTCUTS.get()
+ || Flags.enableSplitFromFullscreenWithKeyboardShortcuts();
+ }
+ // Aconfig migration complete for ENABLE_SPLIT_FROM_WORKSPACE_TO_WORKSPACE.
public static final BooleanFlag ENABLE_SPLIT_FROM_WORKSPACE_TO_WORKSPACE = getDebugFlag(
270393453, "ENABLE_SPLIT_FROM_WORKSPACE_TO_WORKSPACE", DISABLED,
"Enable initiating split screen from workspace to workspace.");
diff --git a/src/com/android/launcher3/responsive/HotseatSpecsProvider.kt b/src/com/android/launcher3/responsive/HotseatSpecsProvider.kt
index 7f7f2f1..8710303 100644
--- a/src/com/android/launcher3/responsive/HotseatSpecsProvider.kt
+++ b/src/com/android/launcher3/responsive/HotseatSpecsProvider.kt
@@ -74,7 +74,7 @@
dimensionType =
DimensionType.entries[
attrs.getInt(
- R.styleable.ResponsiveSpec_specType,
+ R.styleable.ResponsiveSpec_dimensionType,
DimensionType.HEIGHT.ordinal
)],
specType = responsiveSpecType,
diff --git a/src/com/android/launcher3/responsive/ResponsiveSpec.kt b/src/com/android/launcher3/responsive/ResponsiveSpec.kt
index 631a905..413e2dc 100644
--- a/src/com/android/launcher3/responsive/ResponsiveSpec.kt
+++ b/src/com/android/launcher3/responsive/ResponsiveSpec.kt
@@ -72,7 +72,7 @@
dimensionType =
DimensionType.entries[
attrs.getInt(
- R.styleable.ResponsiveSpec_specType,
+ R.styleable.ResponsiveSpec_dimensionType,
DimensionType.HEIGHT.ordinal
)],
specType = responsiveSpecType,
@@ -137,6 +137,9 @@
* they are calculated from the available space, cells and workspace specs.
*/
class CalculatedResponsiveSpec {
+ var aspectRatio: Float = Float.NaN
+ private set
+
var availableSpace: Int = 0
private set
@@ -159,11 +162,13 @@
private set
constructor(
+ aspectRatio: Float,
availableSpace: Int,
cells: Int,
spec: ResponsiveSpec,
calculatedWorkspaceSpec: CalculatedResponsiveSpec
) {
+ this.aspectRatio = aspectRatio
this.availableSpace = availableSpace
this.cells = cells
this.spec = spec
@@ -183,7 +188,8 @@
updateRemainderSpaces(availableSpace, cells, spec)
}
- constructor(availableSpace: Int, cells: Int, spec: ResponsiveSpec) {
+ constructor(aspectRatio: Float, availableSpace: Int, cells: Int, spec: ResponsiveSpec) {
+ this.aspectRatio = aspectRatio
this.availableSpace = availableSpace
this.cells = cells
this.spec = spec
@@ -239,6 +245,7 @@
return "Calculated${spec.specType}Spec(" +
"availableSpace=$availableSpace, cells=$cells, startPaddingPx=$startPaddingPx, " +
"endPaddingPx=$endPaddingPx, gutterPx=$gutterPx, cellSizePx=$cellSizePx, " +
+ "aspectRatio=${aspectRatio}, " +
"${spec.specType}Spec.maxAvailableSize=${spec.maxAvailableSize}" +
")"
}
diff --git a/src/com/android/launcher3/responsive/ResponsiveSpecsProvider.kt b/src/com/android/launcher3/responsive/ResponsiveSpecsProvider.kt
index bc2f4c5..67eaac0 100644
--- a/src/com/android/launcher3/responsive/ResponsiveSpecsProvider.kt
+++ b/src/com/android/launcher3/responsive/ResponsiveSpecsProvider.kt
@@ -76,7 +76,7 @@
): CalculatedResponsiveSpec {
val specsGroup = getSpecsByAspectRatio(aspectRatio)
val spec = specsGroup.getSpec(dimensionType, availableSpace)
- return CalculatedResponsiveSpec(availableSpace, numCells, spec)
+ return CalculatedResponsiveSpec(aspectRatio, availableSpace, numCells, spec)
}
/**
@@ -114,7 +114,13 @@
val specsGroup = getSpecsByAspectRatio(aspectRatio)
val spec = specsGroup.getSpec(dimensionType, availableSpace)
- return CalculatedResponsiveSpec(availableSpace, numCells, spec, calculatedWorkspaceSpec)
+ return CalculatedResponsiveSpec(
+ aspectRatio,
+ availableSpace,
+ numCells,
+ spec,
+ calculatedWorkspaceSpec
+ )
}
companion object {
diff --git a/src/com/android/launcher3/util/DisplayController.java b/src/com/android/launcher3/util/DisplayController.java
index 26ab5b4..0470971 100644
--- a/src/com/android/launcher3/util/DisplayController.java
+++ b/src/com/android/launcher3/util/DisplayController.java
@@ -22,8 +22,8 @@
import static com.android.launcher3.LauncherPrefs.TASKBAR_PINNING;
import static com.android.launcher3.LauncherPrefs.TASKBAR_PINNING_KEY;
import static com.android.launcher3.Utilities.dpiFromPx;
-import static com.android.launcher3.config.FeatureFlags.ENABLE_TASKBAR_PINNING;
import static com.android.launcher3.config.FeatureFlags.ENABLE_TRANSIENT_TASKBAR;
+import static com.android.launcher3.config.FeatureFlags.enableTaskbarPinning;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.launcher3.util.FlagDebugUtils.appendFlag;
import static com.android.launcher3.util.window.WindowManagerProxy.MIN_TABLET_WIDTH;
@@ -116,7 +116,7 @@
mContext = context;
mDM = context.getSystemService(DisplayManager.class);
- if (ENABLE_TASKBAR_PINNING.get()) {
+ if (enableTaskbarPinning()) {
attachTaskbarPinningSharedPreferenceChangeListener(mContext);
}
@@ -179,7 +179,7 @@
@Override
public void close() {
mDestroyed = true;
- if (ENABLE_TASKBAR_PINNING.get()) {
+ if (enableTaskbarPinning()) {
LauncherPrefs.get(mContext).removeListener(
mTaskbarPinningPreferenceChangeListener, TASKBAR_PINNING);
}
@@ -414,7 +414,7 @@
// sTransientTaskbarStatusForTests and update test to directly
// toggle shred preference to switch transient taskbar on/of
if (!Utilities.isRunningInTestHarness()
- && ENABLE_TASKBAR_PINNING.get()
+ && enableTaskbarPinning()
&& mIsTaskbarPinned) {
return false;
}
diff --git a/tests/res/values/attrs.xml b/tests/res/values/attrs.xml
index 4ba4fc7..2a7a346 100644
--- a/tests/res/values/attrs.xml
+++ b/tests/res/values/attrs.xml
@@ -19,7 +19,7 @@
<resources>
<!-- Responsive grids attributes -->
<declare-styleable name="ResponsiveSpec">
- <attr name="specType" format="integer">
+ <attr name="dimensionType" format="integer">
<enum name="height" value="0" />
<enum name="width" value="1" />
</attr>
@@ -31,17 +31,17 @@
</declare-styleable>
<declare-styleable name="WorkspaceSpec">
- <attr name="specType" />
+ <attr name="dimensionType" />
<attr name="maxAvailableSize" />
</declare-styleable>
<declare-styleable name="FolderSpec">
- <attr name="specType" />
+ <attr name="dimensionType" />
<attr name="maxAvailableSize" />
</declare-styleable>
<declare-styleable name="AllAppsSpec">
- <attr name="specType" />
+ <attr name="dimensionType" />
<attr name="maxAvailableSize" />
</declare-styleable>
diff --git a/tests/res/xml/invalid_all_apps_file_case_1.xml b/tests/res/xml/invalid_all_apps_file_case_1.xml
index f09ecd8..d89e675 100644
--- a/tests/res/xml/invalid_all_apps_file_case_1.xml
+++ b/tests/res/xml/invalid_all_apps_file_case_1.xml
@@ -16,7 +16,7 @@
<allAppsSpecs xmlns:launcher="http://schemas.android.com/apk/res-auto">
<specs launcher:maxAspectRatio="10">
<allAppsSpec
- launcher:specType="height"
+ launcher:dimensionType="height"
launcher:maxAvailableSize="9999dp">
<!-- missing startPadding -->
<endPadding launcher:fixedSize="0dp" />
@@ -25,7 +25,7 @@
</allAppsSpec>
<allAppsSpec
- launcher:specType="width"
+ launcher:dimensionType="width"
launcher:maxAvailableSize="9999dp">
<startPadding launcher:matchWorkspace="true" />
<endPadding launcher:matchWorkspace="true" />
diff --git a/tests/res/xml/invalid_all_apps_file_case_2.xml b/tests/res/xml/invalid_all_apps_file_case_2.xml
index 7644def..d5540f2 100644
--- a/tests/res/xml/invalid_all_apps_file_case_2.xml
+++ b/tests/res/xml/invalid_all_apps_file_case_2.xml
@@ -16,7 +16,7 @@
<allAppsSpecs xmlns:launcher="http://schemas.android.com/apk/res-auto">
<specs launcher:maxAspectRatio="10">
<allAppsSpec
- launcher:specType="height"
+ launcher:dimensionType="height"
launcher:maxAvailableSize="9999dp">
<startPadding launcher:fixedSize="0dp" />
<endPadding launcher:fixedSize="0dp" />
@@ -28,7 +28,7 @@
</allAppsSpec>
<allAppsSpec
- launcher:specType="width"
+ launcher:dimensionType="width"
launcher:maxAvailableSize="9999dp">
<startPadding launcher:matchWorkspace="true" />
<endPadding launcher:matchWorkspace="true" />
diff --git a/tests/res/xml/invalid_all_apps_file_case_3.xml b/tests/res/xml/invalid_all_apps_file_case_3.xml
index 5a3bc64..75c2172 100644
--- a/tests/res/xml/invalid_all_apps_file_case_3.xml
+++ b/tests/res/xml/invalid_all_apps_file_case_3.xml
@@ -16,7 +16,7 @@
<allAppsSpecs xmlns:launcher="http://schemas.android.com/apk/res-auto">
<specs launcher:maxAspectRatio="10">
<allAppsSpec
- launcher:specType="height"
+ launcher:dimensionType="height"
launcher:maxAvailableSize="9999dp">
<startPadding launcher:fixedSize="0dp" />
<endPadding launcher:fixedSize="0dp" />
@@ -26,7 +26,7 @@
</allAppsSpec>
<allAppsSpec
- launcher:specType="width"
+ launcher:dimensionType="width"
launcher:maxAvailableSize="9999dp">
<startPadding launcher:matchWorkspace="true" />
<endPadding launcher:matchWorkspace="true" />
diff --git a/tests/res/xml/invalid_folders_specs_1.xml b/tests/res/xml/invalid_folders_specs_1.xml
index 1715ffd..6583d62 100644
--- a/tests/res/xml/invalid_folders_specs_1.xml
+++ b/tests/res/xml/invalid_folders_specs_1.xml
@@ -17,13 +17,13 @@
<!-- Tablet - 6x5 portrait -->
<folderSpecs xmlns:launcher="http://schemas.android.com/apk/res-auto">
<specs launcher:maxAspectRatio="10">
- <folderSpec launcher:specType="width" launcher:maxAvailableSize="800dp">
+ <folderSpec launcher:dimensionType="width" launcher:maxAvailableSize="800dp">
<!-- missing startPadding -->
<endPadding launcher:fixedSize="16dp" />
<gutter launcher:fixedSize="16dp" />
<cellSize launcher:matchWorkspace="true" />
</folderSpec>
- <folderSpec launcher:specType="width" launcher:maxAvailableSize="9999dp">
+ <folderSpec launcher:dimensionType="width" launcher:maxAvailableSize="9999dp">
<startPadding launcher:fixedSize="16dp" />
<endPadding launcher:fixedSize="16dp" />
<gutter launcher:fixedSize="16dp" />
@@ -31,7 +31,7 @@
</folderSpec>
<!-- Height spec is fixed -->
- <folderSpec launcher:specType="height" launcher:maxAvailableSize="9999dp">
+ <folderSpec launcher:dimensionType="height" launcher:maxAvailableSize="9999dp">
<startPadding launcher:fixedSize="24dp" />
<!-- mapped to footer height size -->
<endPadding launcher:fixedSize="64dp" />
diff --git a/tests/res/xml/invalid_folders_specs_2.xml b/tests/res/xml/invalid_folders_specs_2.xml
index bb26e2e..95ac856 100644
--- a/tests/res/xml/invalid_folders_specs_2.xml
+++ b/tests/res/xml/invalid_folders_specs_2.xml
@@ -17,7 +17,7 @@
<!-- Tablet - 6x5 portrait -->
<folderSpecs xmlns:launcher="http://schemas.android.com/apk/res-auto">
<specs launcher:maxAspectRatio="10">
- <folderSpec launcher:specType="width" launcher:maxAvailableSize="800dp">
+ <folderSpec launcher:dimensionType="width" launcher:maxAvailableSize="800dp">
<startPadding launcher:fixedSize="16dp" />
<endPadding launcher:fixedSize="16dp" />
<!-- more than 1 value in one tag -->
@@ -26,7 +26,7 @@
launcher:fixedSize="16dp" />
<cellSize launcher:matchWorkspace="true" />
</folderSpec>
- <folderSpec launcher:specType="width" launcher:maxAvailableSize="9999dp">
+ <folderSpec launcher:dimensionType="width" launcher:maxAvailableSize="9999dp">
<startPadding launcher:fixedSize="16dp" />
<endPadding launcher:fixedSize="16dp" />
<gutter launcher:fixedSize="16dp" />
@@ -34,7 +34,7 @@
</folderSpec>
<!-- Height spec is fixed -->
- <folderSpec launcher:specType="height" launcher:maxAvailableSize="9999dp">
+ <folderSpec launcher:dimensionType="height" launcher:maxAvailableSize="9999dp">
<startPadding launcher:fixedSize="24dp" />
<!-- mapped to footer height size -->
<endPadding launcher:fixedSize="64dp" />
diff --git a/tests/res/xml/invalid_folders_specs_3.xml b/tests/res/xml/invalid_folders_specs_3.xml
index cdd8056..f71040d 100644
--- a/tests/res/xml/invalid_folders_specs_3.xml
+++ b/tests/res/xml/invalid_folders_specs_3.xml
@@ -17,14 +17,14 @@
<!-- Tablet - 6x5 portrait - More the one value first gutter -->
<folderSpecs xmlns:launcher="http://schemas.android.com/apk/res-auto">
<specs launcher:maxAspectRatio="10">
- <folderSpec launcher:specType="width" launcher:maxAvailableSize="800dp">
+ <folderSpec launcher:dimensionType="width" launcher:maxAvailableSize="800dp">
<startPadding launcher:fixedSize="16dp" />
<endPadding launcher:fixedSize="16dp" />
<gutter launcher:fixedSize="16dp" />
<!-- value bigger than 1 -->
<cellSize launcher:ofRemainderSpace="1.001" />
</folderSpec>
- <folderSpec launcher:specType="width" launcher:maxAvailableSize="9999dp">
+ <folderSpec launcher:dimensionType="width" launcher:maxAvailableSize="9999dp">
<startPadding launcher:fixedSize="16dp" />
<endPadding launcher:fixedSize="16dp" />
<gutter launcher:fixedSize="16dp" />
@@ -32,7 +32,7 @@
</folderSpec>
<!-- Height spec is fixed -->
- <folderSpec launcher:specType="height" launcher:maxAvailableSize="9999dp">
+ <folderSpec launcher:dimensionType="height" launcher:maxAvailableSize="9999dp">
<startPadding launcher:fixedSize="24dp" />
<!-- mapped to footer height size -->
<endPadding launcher:fixedSize="64dp" />
diff --git a/tests/res/xml/invalid_folders_specs_4.xml b/tests/res/xml/invalid_folders_specs_4.xml
index cd5f334..24b8ef6 100644
--- a/tests/res/xml/invalid_folders_specs_4.xml
+++ b/tests/res/xml/invalid_folders_specs_4.xml
@@ -16,7 +16,7 @@
<!-- missing height spec -->
<folderSpecs xmlns:launcher="http://schemas.android.com/apk/res-auto">
<specs launcher:maxAspectRatio="10">
- <folderSpec launcher:specType="width" launcher:maxAvailableSize="800dp">
+ <folderSpec launcher:dimensionType="width" launcher:maxAvailableSize="800dp">
<startPadding launcher:fixedSize="16dp" />
<endPadding launcher:fixedSize="16dp" />
<gutter launcher:fixedSize="16dp" />
diff --git a/tests/res/xml/invalid_folders_specs_5.xml b/tests/res/xml/invalid_folders_specs_5.xml
index f554521..6d6f577 100644
--- a/tests/res/xml/invalid_folders_specs_5.xml
+++ b/tests/res/xml/invalid_folders_specs_5.xml
@@ -16,7 +16,7 @@
<!-- missing breakpoints > 800dp -->
<folderSpecs xmlns:launcher="http://schemas.android.com/apk/res-auto">
<specs launcher:maxAspectRatio="10">
- <folderSpec launcher:specType="width" launcher:maxAvailableSize="800dp">
+ <folderSpec launcher:dimensionType="width" launcher:maxAvailableSize="800dp">
<startPadding launcher:fixedSize="16dp" />
<endPadding launcher:fixedSize="16dp" />
<gutter launcher:fixedSize="16dp" />
@@ -24,7 +24,7 @@
</folderSpec>
<!-- Height spec is fixed -->
- <folderSpec launcher:specType="height" launcher:maxAvailableSize="800dp">
+ <folderSpec launcher:dimensionType="height" launcher:maxAvailableSize="800dp">
<startPadding launcher:fixedSize="24dp" />
<!-- mapped to footer height size -->
<endPadding launcher:fixedSize="64dp" />
diff --git a/tests/res/xml/invalid_hotseat_file_case_1.xml b/tests/res/xml/invalid_hotseat_file_case_1.xml
index bd40690..8e0ce2c 100644
--- a/tests/res/xml/invalid_hotseat_file_case_1.xml
+++ b/tests/res/xml/invalid_hotseat_file_case_1.xml
@@ -16,14 +16,14 @@
<hotseatSpecs xmlns:launcher="http://schemas.android.com/apk/res-auto">
<specs launcher:maxAspectRatio="10">
<hotseatSpec
- launcher:specType="height"
+ launcher:dimensionType="height"
launcher:maxAvailableSize="847dp">
<hotseatQsbSpace launcher:ofAvailableSpace="1" />
<edgePadding launcher:fixedSize="36dp" />
</hotseatSpec>
<hotseatSpec
- launcher:specType="height"
+ launcher:dimensionType="height"
launcher:maxAvailableSize="9999dp">
<hotseatQsbSpace launcher:fixedSize="36dp" />
<edgePadding launcher:fixedSize="36dp" />
diff --git a/tests/res/xml/invalid_responsive_spec_1.xml b/tests/res/xml/invalid_responsive_spec_1.xml
index 7a474bf..d1bcf65 100644
--- a/tests/res/xml/invalid_responsive_spec_1.xml
+++ b/tests/res/xml/invalid_responsive_spec_1.xml
@@ -17,7 +17,7 @@
<workspaceSpecs xmlns:launcher="http://schemas.android.com/apk/res-auto">
<workspaceSpec
launcher:maxAvailableSize="9999dp"
- launcher:specType="height">
+ launcher:dimensionType="height">
<cellSize launcher:fixedSize="104dp" />
<endPadding launcher:ofRemainderSpace="1" />
<gutter launcher:fixedSize="16dp" />
@@ -26,7 +26,7 @@
<workspaceSpec
launcher:maxAvailableSize="9999dp"
- launcher:specType="width">
+ launcher:dimensionType="width">
<cellSize launcher:ofRemainderSpace="0.25" />
<endPadding launcher:fixedSize="22dp" />
<gutter launcher:fixedSize="16dp" />
diff --git a/tests/res/xml/invalid_responsive_spec_2.xml b/tests/res/xml/invalid_responsive_spec_2.xml
index 6735300..49e1f93 100644
--- a/tests/res/xml/invalid_responsive_spec_2.xml
+++ b/tests/res/xml/invalid_responsive_spec_2.xml
@@ -18,7 +18,7 @@
<specs launcher:maxAspectRatio="10">
<workspaceSpec
launcher:maxAvailableSize="9999dp"
- launcher:specType="height">
+ launcher:dimensionType="height">
<cellSize launcher:fixedSize="104dp" />
<endPadding launcher:ofRemainderSpace="1" />
<gutter launcher:fixedSize="16dp" />
@@ -27,7 +27,7 @@
<workspaceSpec
launcher:maxAvailableSize="9999dp"
- launcher:specType="width">
+ launcher:dimensionType="width">
<cellSize launcher:ofRemainderSpace="0.25" />
<endPadding launcher:fixedSize="22dp" />
<gutter launcher:fixedSize="16dp" />
@@ -37,7 +37,7 @@
<workspaceSpec
launcher:maxAvailableSize="9999dp"
- launcher:specType="width">
+ launcher:dimensionType="width">
<cellSize launcher:ofRemainderSpace="0.25" />
<endPadding launcher:fixedSize="22dp" />
<gutter launcher:fixedSize="16dp" />
@@ -45,7 +45,7 @@
</workspaceSpec>
<workspaceSpec
launcher:maxAvailableSize="9999dp"
- launcher:specType="height">
+ launcher:dimensionType="height">
<cellSize launcher:fixedSize="104dp" />
<endPadding launcher:ofRemainderSpace="1" />
<gutter launcher:fixedSize="16dp" />
diff --git a/tests/res/xml/invalid_responsive_spec_3.xml b/tests/res/xml/invalid_responsive_spec_3.xml
index 72d0c20..37fee06 100644
--- a/tests/res/xml/invalid_responsive_spec_3.xml
+++ b/tests/res/xml/invalid_responsive_spec_3.xml
@@ -18,7 +18,7 @@
<specs launcher:maxAspectRatio="10">
<workspaceSpec
launcher:maxAvailableSize="9999dp"
- launcher:specType="height">
+ launcher:dimensionType="height">
<cellSize launcher:fixedSize="104dp" />
<endPadding launcher:ofRemainderSpace="1" />
<gutter launcher:fixedSize="16dp" />
@@ -27,7 +27,7 @@
<workspaceSpec
launcher:maxAvailableSize="9999dp"
- launcher:specType="width">
+ launcher:dimensionType="width">
<cellSize launcher:ofRemainderSpace="0.25" />
<endPadding launcher:fixedSize="22dp" />
<gutter launcher:fixedSize="16dp" />
@@ -38,7 +38,7 @@
<specs launcher:maxAspectRatio="0">
<workspaceSpec
launcher:maxAvailableSize="9999dp"
- launcher:specType="height">
+ launcher:dimensionType="height">
<cellSize launcher:fixedSize="104dp" />
<endPadding launcher:ofRemainderSpace="1" />
<gutter launcher:fixedSize="16dp" />
@@ -47,7 +47,7 @@
<workspaceSpec
launcher:maxAvailableSize="9999dp"
- launcher:specType="width">
+ launcher:dimensionType="width">
<cellSize launcher:ofRemainderSpace="0.25" />
<endPadding launcher:fixedSize="22dp" />
<gutter launcher:fixedSize="16dp" />
diff --git a/tests/res/xml/invalid_workspace_file_case_1.xml b/tests/res/xml/invalid_workspace_file_case_1.xml
index fc6ff59..7a234d1 100644
--- a/tests/res/xml/invalid_workspace_file_case_1.xml
+++ b/tests/res/xml/invalid_workspace_file_case_1.xml
@@ -17,7 +17,7 @@
<workspaceSpecs xmlns:launcher="http://schemas.android.com/apk/res-auto">
<specs launcher:maxAspectRatio="10">
<workspaceSpec
- launcher:specType="height"
+ launcher:dimensionType="height"
launcher:maxAvailableSize="648dp">
<!-- missing startPadding -->
<endPadding
@@ -29,7 +29,7 @@
</workspaceSpec>
<workspaceSpec
- launcher:specType="height"
+ launcher:dimensionType="height"
launcher:maxAvailableSize="9999dp">
<startPadding
launcher:ofAvailableSpace="0.0306" />
@@ -43,7 +43,7 @@
<!-- Width spec is always the same -->
<workspaceSpec
- launcher:specType="width"
+ launcher:dimensionType="width"
launcher:maxAvailableSize="9999dp">
<startPadding
launcher:ofRemainderSpace="0.21436227" />
diff --git a/tests/res/xml/invalid_workspace_file_case_2.xml b/tests/res/xml/invalid_workspace_file_case_2.xml
index 2feeb54..6638285 100644
--- a/tests/res/xml/invalid_workspace_file_case_2.xml
+++ b/tests/res/xml/invalid_workspace_file_case_2.xml
@@ -17,7 +17,7 @@
<workspaceSpecs xmlns:launcher="http://schemas.android.com/apk/res-auto">
<specs launcher:maxAspectRatio="10">
<workspaceSpec
- launcher:specType="height"
+ launcher:dimensionType="height"
launcher:maxAvailableSize="648dp">
<startPadding
launcher:ofAvailableSpace="0.0125" />
@@ -32,7 +32,7 @@
</workspaceSpec>
<workspaceSpec
- launcher:specType="height"
+ launcher:dimensionType="height"
launcher:maxAvailableSize="9999dp">
<startPadding
launcher:ofAvailableSpace="0.0306" />
@@ -46,7 +46,7 @@
<!-- Width spec is always the same -->
<workspaceSpec
- launcher:specType="width"
+ launcher:dimensionType="width"
launcher:maxAvailableSize="9999dp">
<startPadding
launcher:ofRemainderSpace="0.21436227" />
diff --git a/tests/res/xml/invalid_workspace_file_case_3.xml b/tests/res/xml/invalid_workspace_file_case_3.xml
index 79e6fbd..cb3e63f 100644
--- a/tests/res/xml/invalid_workspace_file_case_3.xml
+++ b/tests/res/xml/invalid_workspace_file_case_3.xml
@@ -17,7 +17,7 @@
<workspaceSpecs xmlns:launcher="http://schemas.android.com/apk/res-auto">
<specs launcher:maxAspectRatio="10">
<workspaceSpec
- launcher:specType="height"
+ launcher:dimensionType="height"
launcher:maxAvailableSize="648dp">
<startPadding
launcher:ofAvailableSpace="0.0125" />
@@ -31,7 +31,7 @@
</workspaceSpec>
<workspaceSpec
- launcher:specType="height"
+ launcher:dimensionType="height"
launcher:maxAvailableSize="9999dp">
<startPadding
launcher:ofAvailableSpace="0.0306" />
@@ -45,7 +45,7 @@
<!-- Width spec is always the same -->
<workspaceSpec
- launcher:specType="width"
+ launcher:dimensionType="width"
launcher:maxAvailableSize="9999dp">
<startPadding
launcher:ofRemainderSpace="0.21436227" />
diff --git a/tests/res/xml/invalid_workspace_file_case_4.xml b/tests/res/xml/invalid_workspace_file_case_4.xml
index 66a2618..901278d 100644
--- a/tests/res/xml/invalid_workspace_file_case_4.xml
+++ b/tests/res/xml/invalid_workspace_file_case_4.xml
@@ -17,7 +17,7 @@
<workspaceSpecs xmlns:launcher="http://schemas.android.com/apk/res-auto">
<specs launcher:maxAspectRatio="10">
<workspaceSpec
- launcher:specType="height"
+ launcher:dimensionType="height"
launcher:maxAvailableSize="648dp">
<startPadding
launcher:ofAvailableSpace="0.0125" />
@@ -31,7 +31,7 @@
</workspaceSpec>
<workspaceSpec
- launcher:specType="height"
+ launcher:dimensionType="height"
launcher:maxAvailableSize="9999dp">
<startPadding
launcher:ofAvailableSpace="0.0306" />
@@ -45,7 +45,7 @@
<!-- Width spec is always the same -->
<workspaceSpec
- launcher:specType="width"
+ launcher:dimensionType="width"
launcher:maxAvailableSize="9999dp">
<startPadding
launcher:ofRemainderSpace="0.21436227" />
diff --git a/tests/res/xml/valid_all_apps_file.xml b/tests/res/xml/valid_all_apps_file.xml
index f0967c4..33ea9b6 100644
--- a/tests/res/xml/valid_all_apps_file.xml
+++ b/tests/res/xml/valid_all_apps_file.xml
@@ -17,7 +17,7 @@
<allAppsSpecs xmlns:launcher="http://schemas.android.com/apk/res-auto">
<specs launcher:maxAspectRatio="10">
<allAppsSpec
- launcher:specType="height"
+ launcher:dimensionType="height"
launcher:maxAvailableSize="9999dp">
<startPadding launcher:fixedSize="0dp" />
<endPadding launcher:fixedSize="0dp" />
@@ -26,7 +26,7 @@
</allAppsSpec>
<allAppsSpec
- launcher:specType="width"
+ launcher:dimensionType="width"
launcher:maxAvailableSize="9999dp">
<startPadding launcher:matchWorkspace="true" />
<endPadding launcher:matchWorkspace="true" />
diff --git a/tests/res/xml/valid_folders_specs.xml b/tests/res/xml/valid_folders_specs.xml
index 2ef59a9..ecff9b8 100644
--- a/tests/res/xml/valid_folders_specs.xml
+++ b/tests/res/xml/valid_folders_specs.xml
@@ -15,13 +15,13 @@
-->
<folderSpecs xmlns:launcher="http://schemas.android.com/apk/res-auto">
<specs launcher:maxAspectRatio="10">
- <folderSpec launcher:specType="width" launcher:maxAvailableSize="800dp">
+ <folderSpec launcher:dimensionType="width" launcher:maxAvailableSize="800dp">
<startPadding launcher:fixedSize="16dp" />
<endPadding launcher:fixedSize="16dp" />
<gutter launcher:fixedSize="16dp" />
<cellSize launcher:matchWorkspace="true" />
</folderSpec>
- <folderSpec launcher:specType="width" launcher:maxAvailableSize="9999dp">
+ <folderSpec launcher:dimensionType="width" launcher:maxAvailableSize="9999dp">
<startPadding launcher:fixedSize="16dp" />
<endPadding launcher:fixedSize="16dp" />
<gutter launcher:fixedSize="16dp" />
@@ -29,7 +29,7 @@
</folderSpec>
<!-- Height spec is fixed -->
- <folderSpec launcher:specType="height" launcher:maxAvailableSize="9999dp">
+ <folderSpec launcher:dimensionType="height" launcher:maxAvailableSize="9999dp">
<startPadding launcher:fixedSize="24dp" />
<!-- mapped to footer height size -->
<endPadding launcher:fixedSize="64dp" />
diff --git a/tests/res/xml/valid_hotseat_file.xml b/tests/res/xml/valid_hotseat_file.xml
index d1c9e49..65c1d8b 100644
--- a/tests/res/xml/valid_hotseat_file.xml
+++ b/tests/res/xml/valid_hotseat_file.xml
@@ -17,14 +17,14 @@
<specs launcher:maxAspectRatio="10">
<hotseatSpec
launcher:maxAvailableSize="847dp"
- launcher:specType="height">
+ launcher:dimensionType="height">
<hotseatQsbSpace launcher:fixedSize="24dp" />
<edgePadding launcher:fixedSize="48dp" />
</hotseatSpec>
<hotseatSpec
launcher:maxAvailableSize="9999dp"
- launcher:specType="height">
+ launcher:dimensionType="height">
<hotseatQsbSpace launcher:fixedSize="36dp" />
<edgePadding launcher:fixedSize="48dp" />
</hotseatSpec>
diff --git a/tests/res/xml/valid_hotseat_land_file.xml b/tests/res/xml/valid_hotseat_land_file.xml
index a72fd18..f67adad 100644
--- a/tests/res/xml/valid_hotseat_land_file.xml
+++ b/tests/res/xml/valid_hotseat_land_file.xml
@@ -17,14 +17,14 @@
<specs launcher:maxAspectRatio="10">
<hotseatSpec
launcher:maxAvailableSize="743dp"
- launcher:specType="width">
+ launcher:dimensionType="width">
<hotseatQsbSpace launcher:fixedSize="0dp" />
<edgePadding launcher:fixedSize="48dp" />
</hotseatSpec>
<hotseatSpec
launcher:maxAvailableSize="9999dp"
- launcher:specType="width">
+ launcher:dimensionType="width">
<hotseatQsbSpace launcher:fixedSize="0dp" />
<edgePadding launcher:fixedSize="64dp" />
</hotseatSpec>
diff --git a/tests/res/xml/valid_responsive_spec_unsorted.xml b/tests/res/xml/valid_responsive_spec_unsorted.xml
index 7cefc8e..9a463d5 100644
--- a/tests/res/xml/valid_responsive_spec_unsorted.xml
+++ b/tests/res/xml/valid_responsive_spec_unsorted.xml
@@ -17,7 +17,7 @@
<workspaceSpecs xmlns:launcher="http://schemas.android.com/apk/res-auto">
<specs launcher:maxAspectRatio="10">
<workspaceSpec
- launcher:specType="height"
+ launcher:dimensionType="height"
launcher:maxAvailableSize="9999dp">
<startPadding launcher:fixedSize="0dp" />
<endPadding launcher:fixedSize="34dp" />
@@ -27,7 +27,7 @@
<!-- Height spec -->
<workspaceSpec
- launcher:specType="height"
+ launcher:dimensionType="height"
launcher:maxAvailableSize="371dp">
<startPadding launcher:fixedSize="0dp" />
<endPadding launcher:fixedSize="24dp" />
@@ -37,7 +37,7 @@
<!-- Width spec -->
<workspaceSpec
- launcher:specType="width"
+ launcher:dimensionType="width"
launcher:maxAvailableSize="716dp">
<startPadding launcher:fixedSize="16dp" />
<endPadding launcher:fixedSize="64dp" />
@@ -45,7 +45,7 @@
<cellSize launcher:ofRemainderSpace="0.25" />
</workspaceSpec>
<workspaceSpec
- launcher:specType="width"
+ launcher:dimensionType="width"
launcher:maxAvailableSize="9999dp">
<startPadding launcher:fixedSize="36dp" />
<endPadding launcher:fixedSize="80dp" />
@@ -53,7 +53,7 @@
<cellSize launcher:ofRemainderSpace="0.25" />
</workspaceSpec>
<workspaceSpec
- launcher:specType="width"
+ launcher:dimensionType="width"
launcher:maxAvailableSize="602dp">
<startPadding launcher:fixedSize="0dp" />
<endPadding launcher:fixedSize="36dp" />
@@ -66,7 +66,7 @@
<specs launcher:maxAspectRatio="12">
<!-- Height spec -->
<workspaceSpec
- launcher:specType="height"
+ launcher:dimensionType="height"
launcher:maxAvailableSize="9999dp">
<startPadding launcher:fixedSize="2dp" />
<endPadding launcher:fixedSize="2dp" />
@@ -76,7 +76,7 @@
<!-- Width spec -->
<workspaceSpec
- launcher:specType="width"
+ launcher:dimensionType="width"
launcher:maxAvailableSize="9999dp">
<startPadding launcher:fixedSize="1dp" />
<endPadding launcher:fixedSize="1dp" />
@@ -88,7 +88,7 @@
<specs launcher:maxAspectRatio="1.05">
<!-- 584 grid height + 28 remainder space -->
<workspaceSpec
- launcher:specType="height"
+ launcher:dimensionType="height"
launcher:maxAvailableSize="612dp">
<startPadding launcher:fixedSize="0dp" />
<endPadding launcher:ofRemainderSpace="1" />
@@ -97,7 +97,7 @@
</workspaceSpec>
<workspaceSpec
- launcher:specType="height"
+ launcher:dimensionType="height"
launcher:maxAvailableSize="9999dp">
<startPadding launcher:fixedSize="8dp" />
<endPadding launcher:ofRemainderSpace="1" />
@@ -107,7 +107,7 @@
<!-- 584 grid height -->
<workspaceSpec
- launcher:specType="height"
+ launcher:dimensionType="height"
launcher:maxAvailableSize="584dp">
<startPadding launcher:fixedSize="0dp" />
<endPadding launcher:fixedSize="32dp" />
@@ -117,7 +117,7 @@
<!-- Width spec is always the same -->
<workspaceSpec
- launcher:specType="width"
+ launcher:dimensionType="width"
launcher:maxAvailableSize="9999dp">
<startPadding launcher:fixedSize="22dp" />
<endPadding launcher:fixedSize="22dp" />
diff --git a/tests/res/xml/valid_workspace_file.xml b/tests/res/xml/valid_workspace_file.xml
index da5ca11..9c44502 100644
--- a/tests/res/xml/valid_workspace_file.xml
+++ b/tests/res/xml/valid_workspace_file.xml
@@ -18,7 +18,7 @@
<specs launcher:maxAspectRatio="1.05">
<!-- 584 grid height -->
<workspaceSpec
- launcher:specType="height"
+ launcher:dimensionType="height"
launcher:maxAvailableSize="584dp">
<startPadding launcher:fixedSize="0dp" />
<endPadding launcher:fixedSize="32dp" />
@@ -28,7 +28,7 @@
<!-- 584 grid height + 28 remainder space -->
<workspaceSpec
- launcher:specType="height"
+ launcher:dimensionType="height"
launcher:maxAvailableSize="612dp">
<startPadding launcher:fixedSize="0dp" />
<endPadding launcher:ofRemainderSpace="1" />
@@ -37,7 +37,7 @@
</workspaceSpec>
<workspaceSpec
- launcher:specType="height"
+ launcher:dimensionType="height"
launcher:maxAvailableSize="9999dp">
<startPadding launcher:fixedSize="8dp" />
<endPadding launcher:ofRemainderSpace="1" />
@@ -49,7 +49,7 @@
<!-- Width spec is always the same -->
<workspaceSpec
- launcher:specType="width"
+ launcher:dimensionType="width"
launcher:maxAvailableSize="9999dp">
<startPadding launcher:fixedSize="22dp" />
<endPadding launcher:fixedSize="22dp" />
@@ -62,7 +62,7 @@
<specs launcher:maxAspectRatio="99999">
<!-- Height spec -->
<workspaceSpec
- launcher:specType="height"
+ launcher:dimensionType="height"
launcher:maxAvailableSize="371dp">
<startPadding launcher:fixedSize="0dp" />
<endPadding launcher:fixedSize="24dp" />
@@ -70,7 +70,7 @@
<cellSize launcher:ofRemainderSpace="0.25" />
</workspaceSpec>
<workspaceSpec
- launcher:specType="height"
+ launcher:dimensionType="height"
launcher:maxAvailableSize="9999dp">
<startPadding launcher:fixedSize="0dp" />
<endPadding launcher:fixedSize="34dp" />
@@ -80,7 +80,7 @@
<!-- Width spec -->
<workspaceSpec
- launcher:specType="width"
+ launcher:dimensionType="width"
launcher:maxAvailableSize="602dp">
<startPadding launcher:fixedSize="0dp" />
<endPadding launcher:fixedSize="36dp" />
@@ -88,7 +88,7 @@
<cellSize launcher:ofRemainderSpace="0.25" />
</workspaceSpec>
<workspaceSpec
- launcher:specType="width"
+ launcher:dimensionType="width"
launcher:maxAvailableSize="716dp">
<startPadding launcher:fixedSize="16dp" />
<endPadding launcher:fixedSize="64dp" />
@@ -96,7 +96,7 @@
<cellSize launcher:ofRemainderSpace="0.25" />
</workspaceSpec>
<workspaceSpec
- launcher:specType="width"
+ launcher:dimensionType="width"
launcher:maxAvailableSize="9999dp">
<startPadding launcher:fixedSize="36dp" />
<endPadding launcher:fixedSize="80dp" />
diff --git a/tests/res/xml/valid_workspace_unsorted_file.xml b/tests/res/xml/valid_workspace_unsorted_file.xml
index 9f2bdc3..6bf7c78 100644
--- a/tests/res/xml/valid_workspace_unsorted_file.xml
+++ b/tests/res/xml/valid_workspace_unsorted_file.xml
@@ -17,7 +17,7 @@
<workspaceSpecs xmlns:launcher="http://schemas.android.com/apk/res-auto">
<specs launcher:maxAspectRatio="1.05">
<workspaceSpec
- launcher:specType="height"
+ launcher:dimensionType="height"
launcher:maxAvailableSize="9999dp">
<startPadding launcher:fixedSize="8dp" />
<endPadding launcher:ofRemainderSpace="1" />
@@ -27,7 +27,7 @@
<!-- 584 grid height -->
<workspaceSpec
- launcher:specType="height"
+ launcher:dimensionType="height"
launcher:maxAvailableSize="584dp">
<startPadding launcher:fixedSize="0dp" />
<endPadding launcher:fixedSize="32dp" />
@@ -37,7 +37,7 @@
<!-- 584 grid height + 28 remainder space -->
<workspaceSpec
- launcher:specType="height"
+ launcher:dimensionType="height"
launcher:maxAvailableSize="612dp">
<startPadding launcher:fixedSize="0dp" />
<endPadding launcher:ofRemainderSpace="1" />
@@ -47,7 +47,7 @@
<!-- Width spec is always the same -->
<workspaceSpec
- launcher:specType="width"
+ launcher:dimensionType="width"
launcher:maxAvailableSize="9999dp">
<startPadding launcher:fixedSize="22dp" />
<endPadding launcher:fixedSize="22dp" />
diff --git a/tests/src/com/android/launcher3/responsive/FolderSpecTest.kt b/tests/src/com/android/launcher3/responsive/FolderSpecTest.kt
index 1756c9a..5cfa49f 100644
--- a/tests/src/com/android/launcher3/responsive/FolderSpecTest.kt
+++ b/tests/src/com/android/launcher3/responsive/FolderSpecTest.kt
@@ -129,7 +129,8 @@
gutter = SizeSpec(fixedSize = 10f),
cellSize = SizeSpec(fixedSize = 10f)
)
- val calculatedWorkspaceSpec = CalculatedResponsiveSpec(availableSpace, cells, workspaceSpec)
+ val calculatedWorkspaceSpec =
+ CalculatedResponsiveSpec(aspectRatio, availableSpace, cells, workspaceSpec)
val resourceHelper = TestResourceHelper(context, R.xml.invalid_folders_specs_5)
val folderSpecs = ResponsiveSpecsProvider.create(resourceHelper, ResponsiveSpecType.Folder)
@@ -157,7 +158,8 @@
gutter = SizeSpec(fixedSize = 10f),
cellSize = SizeSpec(fixedSize = 10f)
)
- val calculatedWorkspaceSpec = CalculatedResponsiveSpec(availableSpace, cells, workspaceSpec)
+ val calculatedWorkspaceSpec =
+ CalculatedResponsiveSpec(aspectRatio, availableSpace, cells, workspaceSpec)
val resourceHelper = TestResourceHelper(context, R.xml.invalid_folders_specs_5)
val folderSpecs = ResponsiveSpecsProvider.create(resourceHelper, ResponsiveSpecType.Folder)
@@ -185,7 +187,8 @@
gutter = SizeSpec(fixedSize = 10f),
cellSize = SizeSpec(fixedSize = 10f)
)
- val calculatedWorkspaceSpec = CalculatedResponsiveSpec(availableSpace, cells, workspaceSpec)
+ val calculatedWorkspaceSpec =
+ CalculatedResponsiveSpec(aspectRatio, availableSpace, cells, workspaceSpec)
val resourceHelper = TestResourceHelper(context, R.xml.valid_folders_specs)
val folderSpecs = ResponsiveSpecsProvider.create(resourceHelper, ResponsiveSpecType.Folder)
@@ -221,7 +224,8 @@
gutter = SizeSpec(fixedSize = 10f),
cellSize = SizeSpec(fixedSize = 10f)
)
- val calculatedWorkspaceSpec = CalculatedResponsiveSpec(availableSpace, cells, workspaceSpec)
+ val calculatedWorkspaceSpec =
+ CalculatedResponsiveSpec(aspectRatio, availableSpace, cells, workspaceSpec)
val resourceHelper = TestResourceHelper(context, R.xml.valid_folders_specs)
val folderSpecs = ResponsiveSpecsProvider.create(resourceHelper, ResponsiveSpecType.Folder)
@@ -249,7 +253,8 @@
gutter = SizeSpec(fixedSize = 10f),
cellSize = SizeSpec(fixedSize = 10f)
)
- val calculatedWorkspaceSpec = CalculatedResponsiveSpec(availableSpace, cells, workspaceSpec)
+ val calculatedWorkspaceSpec =
+ CalculatedResponsiveSpec(aspectRatio, availableSpace, cells, workspaceSpec)
val resourceHelper = TestResourceHelper(context, R.xml.valid_folders_specs)
val folderSpecs = ResponsiveSpecsProvider.create(resourceHelper, ResponsiveSpecType.Folder)
@@ -285,7 +290,8 @@
gutter = SizeSpec(fixedSize = 10f),
cellSize = SizeSpec(fixedSize = 10f)
)
- val calculatedWorkspaceSpec = CalculatedResponsiveSpec(availableSpace, cells, workspaceSpec)
+ val calculatedWorkspaceSpec =
+ CalculatedResponsiveSpec(aspectRatio, availableSpace, cells, workspaceSpec)
val resourceHelper = TestResourceHelper(context, R.xml.valid_folders_specs)
val folderSpecs = ResponsiveSpecsProvider.create(resourceHelper, ResponsiveSpecType.Folder)
diff --git a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
index 217ce7d..688f418 100644
--- a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
+++ b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
@@ -105,12 +105,20 @@
private static boolean sDumpWasGenerated = false;
private static boolean sActivityLeakReported = false;
private static boolean sSeenKeyguard = false;
+ private static boolean sFirstTimeWaitingForWizard = true;
private static final String SYSTEMUI_PACKAGE = "com.android.systemui";
protected LooperExecutor mMainThreadExecutor = MAIN_EXECUTOR;
protected final UiDevice mDevice = getUiDevice();
- protected final LauncherInstrumentation mLauncher = new LauncherInstrumentation();
+ protected final LauncherInstrumentation mLauncher = createLauncherInstrumentation();
+
+ @NonNull
+ private static LauncherInstrumentation createLauncherInstrumentation() {
+ waitForSetupWizardDismissal(); // precondition for creating LauncherInstrumentation
+ return new LauncherInstrumentation();
+ }
+
protected Context mTargetContext;
protected String mTargetPackage;
private int mLauncherPid;
@@ -252,8 +260,6 @@
public void setUp() throws Exception {
mLauncher.onTestStart();
- waitForSetupWizardDismissal();
-
final String launcherPackageName = mDevice.getLauncherPackageName();
try {
final Context context = InstrumentationRegistry.getContext();
@@ -289,6 +295,8 @@
/** Method that should be called when a test starts. */
public static void onTestStart() {
+ waitForSetupWizardDismissal();
+
if (TestStabilityRule.isPresubmit()) {
aggressivelyUnlockSysUi();
} else {
@@ -323,18 +331,8 @@
Log.d(TAG, "Keyguard is not visible");
}
- // b/309008042
- private static boolean sFirstTimeWaitingForWizard = true;
-
- // b/309008042
- static {
- waitForSetupWizardDismissal();
- }
-
- // b/309008042
- // TODO(309471958) Productize killing/dismissal of setup wizard.
/** Waits for setup wizard to go away. */
- public static void waitForSetupWizardDismissal() {
+ private static void waitForSetupWizardDismissal() {
if (!TestStabilityRule.isPresubmit()) return;
if (sFirstTimeWaitingForWizard) {
@@ -467,7 +465,6 @@
// flakiness.
protected void waitForLauncherCondition(
String message, Function<Launcher, Boolean> condition, long timeout) {
- waitForSetupWizardDismissal();
verifyKeyguardInvisible();
if (!TestHelpers.isInLauncherProcess()) return;
Wait.atMost(message, () -> getFromLauncher(condition), timeout, mLauncher);
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
index 536e525..e30885b 100644
--- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
+++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
@@ -273,11 +273,11 @@
mDevice.executeShellCommand(
"pm enable --user " + userId + " " + cn.flattenToString());
// Wait for Launcher restart after enabling test provider.
- for (int i = 0; i < 600; ++i) {
+ for (int i = 0; i < 100; ++i) {
final String currentPid = mDevice.executeShellCommand(launcherPidCommand)
.replaceAll("\\s", "");
if (!currentPid.isEmpty() && !currentPid.equals(initialPid)) break;
- if (i == 599) fail("Launcher didn't restart after enabling test provider");
+ if (i == 99) fail("Launcher didn't restart after enabling test provider");
SystemClock.sleep(100);
}
} catch (IOException e) {