diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2021-06-19 00:40:46 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2021-06-19 00:40:46 +0000 |
commit | d7e17a860f43e248845597f37b17b725e522c00c (patch) | |
tree | 0818af742197389418342c40f77f5deb131ab7bd /quickstep/src | |
parent | 70565c5e7d1a9c06628a845a6162b8961da67779 (diff) | |
parent | 6e1ce8ccb89a72ffddec4d8af7170f6b20d651a9 (diff) |
Merge "Fixing out of order taskbar callbacks" into sc-v2-dev
Diffstat (limited to 'quickstep/src')
3 files changed, 19 insertions, 8 deletions
diff --git a/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java b/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java index 872633ca48..4eb2d53b46 100644 --- a/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java +++ b/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java @@ -132,7 +132,7 @@ public abstract class BaseQuickstepLauncher extends Launcher unbindService(mTisBinderConnection); if (mTaskbarManager != null) { - mTaskbarManager.setLauncher(null); + mTaskbarManager.clearLauncher(this); } super.onDestroy(); } diff --git a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java index 7d0afe1aba..12ac0f5692 100644 --- a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java +++ b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java @@ -98,11 +98,11 @@ public class LauncherTaskbarUIController extends TaskbarUIController { @Override protected void onDestroy() { + onLauncherResumedOrPaused(false); mIconAlignmentForResumedState.finishAnimation(); mIconAlignmentForGestureState.finishAnimation(); mHotseatController.cleanup(); - setTaskbarViewVisible(true); mLauncher.getHotseat().setIconsAlpha(1f); mLauncher.setTaskbarUIController(null); } diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java index 9f5ea50480..788a36b31a 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java @@ -26,7 +26,7 @@ import android.content.Context; import android.hardware.display.DisplayManager; import android.view.Display; -import androidx.annotation.Nullable; +import androidx.annotation.NonNull; import com.android.launcher3.BaseQuickstepLauncher; import com.android.launcher3.DeviceProfile; @@ -103,14 +103,25 @@ public class TaskbarManager implements DisplayController.DisplayInfoChangeListen } /** - * Sets or clears a launcher to act as taskbar callback + * Sets a launcher to act as taskbar callback */ - public void setLauncher(@Nullable BaseQuickstepLauncher launcher) { + public void setLauncher(@NonNull BaseQuickstepLauncher launcher) { mLauncher = launcher; if (mTaskbarActivityContext != null) { - mTaskbarActivityContext.setUIController(mLauncher == null - ? TaskbarUIController.DEFAULT - : new LauncherTaskbarUIController(launcher, mTaskbarActivityContext)); + mTaskbarActivityContext.setUIController( + new LauncherTaskbarUIController(launcher, mTaskbarActivityContext)); + } + } + + /** + * Clears a previously set Launcher + */ + public void clearLauncher(@NonNull BaseQuickstepLauncher launcher) { + if (mLauncher == launcher) { + mLauncher = null; + if (mTaskbarActivityContext != null) { + mTaskbarActivityContext.setUIController(TaskbarUIController.DEFAULT); + } } } |