From 5c32af7e5bca514583ac872dce577fbcd4a8ded9 Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Mon, 12 Aug 2024 23:36:11 +0000 Subject: [PATCH] Fix Taskbar being visible over Hotseat when recreated in Overview Debugging locally, it seems there were a couple of state changes and the last one (which is correct) was getting clobbered by a previously destroyed instance of TaskbarLauncherStateController. Fixed this by updating the isDestroyed() call which previously only checked TaskbarActivityContext to now check TaskbarLauncherStateController's destroyed state directly. This is needed because TaskbarLauncherStateController is part of LauncherTaskbarUIController which can be destroyed independently of the other Taskbar controllers when Launcher is destroyed. Also fix a debug log that was not updated long ago in ag/21122190 Flag: EXEMPT bugfix Test: Go to overview, change Font Scale or Dark Theme from Quick settings, ensure Taskbar is not visible over Hotseat Fixes: 302923055 Change-Id: I1299462955b51a2bf931f022177045b1cec039c5 --- .../launcher3/taskbar/TaskbarLauncherStateController.java | 6 ++++-- .../android/launcher3/taskbar/TaskbarViewController.java | 1 - .../android/launcher3/allapps/TaplOpenCloseAllAppsTest.java | 3 --- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java index 5c3add29a0..a5395d9be9 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java @@ -146,6 +146,7 @@ public class TaskbarLauncherStateController { private MultiProperty mIconAlphaForHome; private QuickstepLauncher mLauncher; + private boolean mIsDestroyed = false; private Integer mPrevState; private int mState; private LauncherState mLauncherState = LauncherState.NORMAL; @@ -256,6 +257,7 @@ public class TaskbarLauncherStateController { } public void onDestroy() { + mIsDestroyed = true; mCanSyncViews = false; mIconAlignment.finishAnimation(); @@ -407,7 +409,7 @@ public class TaskbarLauncherStateController { } public Animator applyState(long duration, boolean start) { - if (mControllers.taskbarActivityContext.isDestroyed()) { + if (mIsDestroyed) { return null; } Animator animator = null; @@ -753,7 +755,7 @@ public class TaskbarLauncherStateController { } private void updateIconAlphaForHome(float alpha) { - if (mControllers.taskbarActivityContext.isDestroyed()) { + if (mIsDestroyed) { return; } mIconAlphaForHome.setValue(alpha); diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java index b8b85d120a..4b3ed96fd5 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java @@ -950,7 +950,6 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar "ALPHA_INDEX_RECENTS_DISABLED", "ALPHA_INDEX_NOTIFICATION_EXPANDED", "ALPHA_INDEX_ASSISTANT_INVOKED", - "ALPHA_INDEX_IME_BUTTON_NAV", "ALPHA_INDEX_SMALL_SCREEN"); mModelCallbacks.dumpLogs(prefix + "\t", pw); diff --git a/tests/src/com/android/launcher3/allapps/TaplOpenCloseAllAppsTest.java b/tests/src/com/android/launcher3/allapps/TaplOpenCloseAllAppsTest.java index 05a122456f..c7c9dbb4bb 100644 --- a/tests/src/com/android/launcher3/allapps/TaplOpenCloseAllAppsTest.java +++ b/tests/src/com/android/launcher3/allapps/TaplOpenCloseAllAppsTest.java @@ -25,7 +25,6 @@ import static org.junit.Assume.assumeTrue; import android.content.Intent; import android.platform.test.annotations.PlatinumTest; -import androidx.test.filters.FlakyTest; import androidx.test.platform.app.InstrumentationRegistry; import com.android.launcher3.Launcher; @@ -33,7 +32,6 @@ import com.android.launcher3.LauncherState; import com.android.launcher3.tapl.AllApps; import com.android.launcher3.ui.AbstractLauncherUiTest; import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape; -import com.android.launcher3.util.rule.ScreenRecordRule; import org.junit.Test; @@ -191,7 +189,6 @@ public class TaplOpenCloseAllAppsTest extends AbstractLauncherUiTest { /** * Makes sure that when pressing back when AllApps is open we go back to the Home screen. */ - @FlakyTest(bugId = 256615483) @Test @PortraitLandscape public void testPressBackFromAllAppsToHome() {