Fix KI in test and re-enable for postsubmit.

- The taskbar stashing logic with hardware keyboards was different
  between tests and user experience; aligned the test to be the
  same.
- There is still a previous test failure that only occurred in
  post submit, so also add ScreenRecord to diagnose it
- Once that is resolved, can promote the test to PRESUBMIT.

Test: testQuickSwitchToPreviousAppForTablet
Flag: NA
Fixes: 318544733
Bug: 314873201
Change-Id: Ia813eb0294d759c40d90cec7a8e9a7e0aea2d917
This commit is contained in:
Tony Wickham committed 2024-01-03 23:27:18 +00:00
1 parent afbf61a150
commit c5d4e4dcf5
3 files changed
+17 -6

No files matched your search

@@ -21,9 +21,7 @@ import static com.android.app.animation.Interpolators.EMPHASIZED;
import static com.android.app.animation.Interpolators.FINAL_FRAME;
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_NAVBAR_UNIFICATION;
import static com.android.launcher3.config.FeatureFlags.enableTaskbarPinning;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TRANSIENT_TASKBAR_HIDE;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TRANSIENT_TASKBAR_SHOW;
import static com.android.launcher3.taskbar.TaskbarKeyguardController.MASK_ANY_SYSUI_LOCKED;
@@ -59,7 +57,6 @@ import androidx.annotation.VisibleForTesting;
import com.android.internal.jank.InteractionJankMonitor;
import com.android.launcher3.Alarm;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.LauncherPrefs;
import com.android.launcher3.R;
import com.android.launcher3.anim.AnimatedFloat;
import com.android.launcher3.anim.AnimatorListeners;
@@ -949,8 +946,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
return false;
}
// Do not stash if pinned taskbar and hardware keyboard is attached.
if (mActivity.isHardwareKeyboard() && enableTaskbarPinning()
&& LauncherPrefs.get(mActivity).get(TASKBAR_PINNING)) {
if (mActivity.isHardwareKeyboard() && DisplayController.isPinnedTaskbar(mActivity)) {
return false;
}
return mIsImeShowing || mIsImeSwitcherShowing;
@@ -295,7 +295,9 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest {
@Test
@TaskbarModeSwitch
@Ignore // b/314873201
@ScreenRecord // b/314873201
// Staging; will be promoted to presubmit if stable
@TestStabilityRule.Stability(flavors = LOCAL | PLATFORM_POSTSUBMIT)
public void testQuickSwitchToPreviousAppForTablet() throws Exception {
assumeTrue(mLauncher.isTablet());
startTestActivity(2);
@@ -175,6 +175,13 @@ public class DisplayController implements ComponentCallbacks, SafeCloseable {
sTransientTaskbarStatusForTests = enable;
}
/**
* Returns whether the taskbar is pinned in gesture navigation mode.
*/
public static boolean isPinnedTaskbar(Context context) {
return INSTANCE.get(context).getInfo().isPinnedTaskbar();
}
@Override
public void close() {
mDestroyed = true;
@@ -423,6 +430,12 @@ public class DisplayController implements ComponentCallbacks, SafeCloseable {
}
return true;
}
/**
* Returns whether the taskbar is pinned in gesture navigation mode.
*/
public boolean isPinnedTaskbar() {
return navigationMode == NavigationMode.NO_BUTTON && !isTransientTaskbar();
}
/**
* Returns {@code true} if the bounds represent a tablet.