Merge "Revert "Update Tapl tests for enable_grid_only_overview"" into main
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarInsetsController.kt b/quickstep/src/com/android/launcher3/taskbar/TaskbarInsetsController.kt
index 881f5c4..0b52195 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarInsetsController.kt
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarInsetsController.kt
@@ -41,7 +41,7 @@
import com.android.launcher3.DeviceProfile
import com.android.launcher3.R
import com.android.launcher3.anim.AlphaUpdateListener
-import com.android.launcher3.config.FeatureFlags.ENABLE_TASKBAR_NO_RECREATION
+import com.android.launcher3.config.FeatureFlags.enableTaskbarNoRecreate
import com.android.launcher3.taskbar.TaskbarControllers.LoggableTaskbarController
import com.android.launcher3.util.DisplayController
import java.io.PrintWriter
@@ -99,7 +99,7 @@
}
windowLayoutParams.providedInsets =
- if (ENABLE_TASKBAR_NO_RECREATION.get()) {
+ if (enableTaskbarNoRecreate()) {
getProvidedInsets(controllers.sharedState!!.insetsFrameProviders!!,
insetsRoundedCornerFlag)
} else {
@@ -225,7 +225,6 @@
provider.insetsSize = Insets.of(0, 0, rightIndexInset, 0)
}
-
// When in gesture nav, report the stashed height to the IME, to allow hiding the
// IME navigation bar.
val imeInsetsSize = if (ENABLE_HIDE_IME_CAPTION_BAR && context.isGestureNav) {
@@ -236,6 +235,12 @@
val imeInsetsSizeOverride =
arrayOf(
InsetsFrameProvider.InsetsSizeOverride(TYPE_INPUT_METHOD, imeInsetsSize),
+ InsetsFrameProvider.InsetsSizeOverride(TYPE_VOICE_INTERACTION,
+ // No-op override to keep the size and types in sync with the
+ // override below (insetsSizeOverrides must have the same length and
+ // types after the window is added according to
+ // WindowManagerService#relayoutWindow)
+ provider.insetsSize)
)
// Use 0 tappableElement insets for the VoiceInteractionWindow when gesture nav is enabled.
val visInsetsSizeForTappableElement =
@@ -244,8 +249,7 @@
val insetsSizeOverrideForTappableElement =
arrayOf(
InsetsFrameProvider.InsetsSizeOverride(TYPE_INPUT_METHOD, imeInsetsSize),
- InsetsFrameProvider.InsetsSizeOverride(
- TYPE_VOICE_INTERACTION,
+ InsetsFrameProvider.InsetsSizeOverride(TYPE_VOICE_INTERACTION,
visInsetsSizeForTappableElement
),
)
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
index 0d06088..0780cf8 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
@@ -714,13 +714,19 @@
continue;
}
- int positionInHotseat;
- if (isAllAppsButton || isTaskbarDividerView) {
- // Note that there is no All Apps button or taskbar divider view in the hotseat,
+ float positionInHotseat;
+ if (isAllAppsButton) {
+ // Note that there is no All Apps button in the hotseat,
// this position is only used as its convenient for animation purposes.
positionInHotseat = Utilities.isRtl(child.getResources())
? taskbarDp.numShownHotseatIcons
: -1;
+ } else if (isTaskbarDividerView) {
+ // Note that there is no taskbar divider view in the hotseat,
+ // this position is only used as its convenient for animation purposes.
+ positionInHotseat = Utilities.isRtl(child.getResources())
+ ? taskbarDp.numShownHotseatIcons - 0.5f
+ : -0.5f;
} else if (child.getTag() instanceof ItemInfo) {
positionInHotseat = ((ItemInfo) child.getTag()).screenId;
} else {
diff --git a/quickstep/src/com/android/quickstep/SystemUiProxy.java b/quickstep/src/com/android/quickstep/SystemUiProxy.java
index 038a022..5147538 100644
--- a/quickstep/src/com/android/quickstep/SystemUiProxy.java
+++ b/quickstep/src/com/android/quickstep/SystemUiProxy.java
@@ -17,6 +17,8 @@
import static android.app.ActivityManager.RECENT_IGNORE_UNAVAILABLE;
+import static com.android.launcher3.testing.shared.TestProtocol.SPLIT_LEAK;
+import static com.android.launcher3.testing.shared.TestProtocol.testLogD;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import static com.android.launcher3.util.SplitConfigurationOptions.StagePosition;
@@ -270,6 +272,7 @@
*/
@MainThread
public void clearProxy() {
+ testLogD(SPLIT_LEAK, "systemUiProxy clearingProxy");
setProxy(null, null, null, null, null, null, null, null, null, null, null, null, null);
}
diff --git a/quickstep/tests/src/com/android/quickstep/util/TaskViewSimulatorTest.java b/quickstep/tests/src/com/android/quickstep/util/TaskViewSimulatorTest.java
index a54dc2d..b365173 100644
--- a/quickstep/tests/src/com/android/quickstep/util/TaskViewSimulatorTest.java
+++ b/quickstep/tests/src/com/android/quickstep/util/TaskViewSimulatorTest.java
@@ -18,11 +18,15 @@
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+import android.content.Context;
+import android.content.res.Configuration;
import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.RectF;
import android.util.ArrayMap;
+import android.util.DisplayMetrics;
import android.view.RemoteAnimationTarget;
import android.view.Surface;
@@ -35,7 +39,6 @@
import com.android.launcher3.util.DisplayController.Info;
import com.android.launcher3.util.LauncherModelHelper;
import com.android.launcher3.util.NavigationMode;
-import com.android.launcher3.util.ReflectionHelpers;
import com.android.launcher3.util.RotationUtils;
import com.android.launcher3.util.WindowBounds;
import com.android.launcher3.util.window.CachedDisplayInfo;
@@ -61,6 +64,7 @@
public void taskProperlyScaled_portrait_noRotation_sameInsets1() {
new TaskMatrixVerifier()
.withLauncherSize(1200, 2450)
+ .withDensityDpi(420)
.withInsets(new Rect(0, 80, 0, 120))
.verifyNoTransforms();
}
@@ -69,6 +73,7 @@
public void taskProperlyScaled_portrait_noRotation_sameInsets2() {
new TaskMatrixVerifier()
.withLauncherSize(1200, 2450)
+ .withDensityDpi(420)
.withInsets(new Rect(55, 80, 55, 120))
.verifyNoTransforms();
}
@@ -77,6 +82,7 @@
public void taskProperlyScaled_landscape_noRotation_sameInsets1() {
new TaskMatrixVerifier()
.withLauncherSize(2450, 1250)
+ .withDensityDpi(420)
.withInsets(new Rect(0, 80, 0, 40))
.verifyNoTransforms();
}
@@ -85,6 +91,7 @@
public void taskProperlyScaled_landscape_noRotation_sameInsets2() {
new TaskMatrixVerifier()
.withLauncherSize(2450, 1250)
+ .withDensityDpi(420)
.withInsets(new Rect(0, 80, 120, 0))
.verifyNoTransforms();
}
@@ -93,6 +100,7 @@
public void taskProperlyScaled_landscape_noRotation_sameInsets3() {
new TaskMatrixVerifier()
.withLauncherSize(2450, 1250)
+ .withDensityDpi(420)
.withInsets(new Rect(55, 80, 55, 120))
.verifyNoTransforms();
}
@@ -101,6 +109,7 @@
public void taskProperlyScaled_landscape_rotated() {
new TaskMatrixVerifier()
.withLauncherSize(1200, 2450)
+ .withDensityDpi(420)
.withInsets(new Rect(0, 80, 0, 120))
.withAppBounds(
new Rect(0, 0, 2450, 1200),
@@ -112,6 +121,7 @@
private static class TaskMatrixVerifier extends TransformParams {
private Point mDisplaySize = new Point();
+ private int mDensityDpi = DisplayMetrics.DENSITY_DEFAULT;
private Rect mDisplayInsets = new Rect();
private Rect mAppBounds = new Rect();
private Rect mLauncherInsets = new Rect();
@@ -129,6 +139,11 @@
return this;
}
+ TaskMatrixVerifier withDensityDpi(int densityDpi) {
+ mDensityDpi = densityDpi;
+ return this;
+ }
+
TaskMatrixVerifier withInsets(Rect insets) {
mDisplayInsets.set(insets);
mLauncherInsets.set(insets);
@@ -173,13 +188,17 @@
new ArrayMap<>();
perDisplayBoundsCache.put(cdi.normalize(), allBounds);
- DisplayController.Info mockInfo = new Info(
- helper.sandboxContext, wmProxy, perDisplayBoundsCache);
+ Configuration configuration = new Configuration();
+ configuration.densityDpi = mDensityDpi;
+ Context configurationContext = helper.sandboxContext.createConfigurationContext(
+ configuration);
- DisplayController controller =
- DisplayController.INSTANCE.get(helper.sandboxContext);
- controller.close();
- ReflectionHelpers.setField(controller, "mInfo", mockInfo);
+ DisplayController.Info info = new Info(
+ configurationContext, wmProxy, perDisplayBoundsCache);
+
+ DisplayController mockController = mock(DisplayController.class);
+ when(mockController.getInfo()).thenReturn(info);
+ helper.sandboxContext.putObject(DisplayController.INSTANCE, mockController);
mDeviceProfile = InvariantDeviceProfile.INSTANCE.get(helper.sandboxContext)
.getBestMatch(mAppBounds.width(), mAppBounds.height(), rotation);
@@ -189,7 +208,7 @@
FallbackActivityInterface.INSTANCE);
tvs.setDp(mDeviceProfile);
- int launcherRotation = mockInfo.rotation;
+ int launcherRotation = info.rotation;
if (mAppRotation < 0) {
mAppRotation = launcherRotation;
}
diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java
index 4e7ec0b..c783ee1 100644
--- a/src/com/android/launcher3/config/FeatureFlags.java
+++ b/src/com/android/launcher3/config/FeatureFlags.java
@@ -276,7 +276,7 @@
// TODO(Block 17): Clean up flags
public static final BooleanFlag ENABLE_TASKBAR_PINNING = getDebugFlag(270396583,
- "ENABLE_TASKBAR_PINNING", DISABLED,
+ "ENABLE_TASKBAR_PINNING", TEAMFOOD,
"Enables taskbar pinning to allow user to switch between transient and persistent "
+ "taskbar flavors");
diff --git a/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java b/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java
index 3e80e6b..eb45ded 100644
--- a/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java
+++ b/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java
@@ -158,6 +158,7 @@
public static final String PERMANENT_DIAG_TAG = "TaplTarget";
public static final String TWO_TASKBAR_LONG_CLICKS = "b/262282528";
public static final String ICON_MISSING = "b/282963545";
+ public static final String SPLIT_LEAK = "b/302551868";
public static final String REQUEST_EMULATE_DISPLAY = "emulate-display";
public static final String REQUEST_STOP_EMULATE_DISPLAY = "stop-emulate-display";
diff --git a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
index ed846ed..4184868 100644
--- a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
+++ b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
@@ -91,7 +91,7 @@
import java.util.function.Supplier;
/**
- * Base class for all instrumentation tests providing various utility methods. RUN 4
+ * Base class for all instrumentation tests providing various utility methods.
*/
public abstract class AbstractLauncherUiTest {