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

Commit e4b5ab65 authored by Vinit Nayak's avatar Vinit Nayak Committed by Android (Google) Code Review
Browse files

Merge "Null out launcher reference to prevent leak" into main

parents 60dcb19a e363a611
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);