Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d7e17a86 authored by Sunny Goyal's avatar Sunny Goyal Committed by Android (Google) Code Review
Browse files

Merge "Fixing out of order taskbar callbacks" into sc-v2-dev

parents 70565c5e 6e1ce8cc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -132,7 +132,7 @@ public abstract class BaseQuickstepLauncher extends Launcher

        unbindService(mTisBinderConnection);
        if (mTaskbarManager != null) {
            mTaskbarManager.setLauncher(null);
            mTaskbarManager.clearLauncher(this);
        }
        super.onDestroy();
    }
+1 −1
Original line number Diff line number Diff line
@@ -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);
    }
+17 −6
Original line number Diff line number Diff line
@@ -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);
            }
        }
    }