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

Commit e363a611 authored by Vinit Nayak's avatar Vinit Nayak
Browse files

Null out launcher reference to prevent leak

Bug: 314806687
Flag: None
Test: Enabled flag and played with taskbar/home transitions,
seemed fine

Change-Id: I86ab417eccf1fd6255195025890a1b93bf5d3bb4
parent 0c2204dc
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -28,19 +28,16 @@ import com.android.wm.shell.transition.IHomeTransitionListener;
 */
public class HomeTransitionController {

    private final QuickstepLauncher mLauncher;
    @Nullable private QuickstepLauncher mLauncher;
    @Nullable private IHomeTransitionListener mHomeTransitionListener;

    public HomeTransitionController(QuickstepLauncher launcher) {
    public void registerHomeTransitionListener(QuickstepLauncher launcher) {
        mLauncher = launcher;
    }

    public void registerHomeTransitionListener() {
        mHomeTransitionListener = new IHomeTransitionListener.Stub() {
            @Override
            public void onHomeVisibilityChanged(boolean isVisible) {
                MAIN_EXECUTOR.execute(() -> {
                    if (mLauncher.getTaskbarUIController() != null) {
                    if (mLauncher != null && mLauncher.getTaskbarUIController() != null) {
                        mLauncher.getTaskbarUIController().onLauncherVisibilityChanged(isVisible);
                    }
                });
@@ -53,5 +50,6 @@ public class HomeTransitionController {
    public void unregisterHomeTransitionListener() {
        SystemUiProxy.INSTANCE.get(mLauncher).setHomeTransitionListener(null);
        mHomeTransitionListener = null;
        mLauncher = null;
    }
}
+2 −2
Original line number Diff line number Diff line
@@ -266,8 +266,8 @@ public class QuickstepLauncher extends Launcher {
        mAppTransitionManager.registerRemoteTransitions();

        if (FeatureFlags.enableHomeTransitionListener()) {
            mHomeTransitionController = new HomeTransitionController(this);
            mHomeTransitionController.registerHomeTransitionListener();
            mHomeTransitionController = new HomeTransitionController();
            mHomeTransitionController.registerHomeTransitionListener(this);
        }

        mTISBindHelper = new TISBindHelper(this, this::onTISConnected);