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

Commit ad412049 authored by Winson Chung's avatar Winson Chung
Browse files

Manage ref to transition manager from binder object

Bug: 186121207
Test: Presubmit
Change-Id: I14735708f1368e2b008e1e8d44273d569219e5df
parent 199c1850
Loading
Loading
Loading
Loading
+18 −6
Original line number Diff line number Diff line
@@ -172,6 +172,8 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
    private final float mClosingWindowTransY;
    private final float mMaxShadowRadius;

    private final StartingWindowListener mStartingWindowListener = new StartingWindowListener();

    private DeviceProfile mDeviceProfile;

    private RemoteAnimationProvider mRemoteAnimationProvider;
@@ -221,13 +223,9 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
                }
            };

            mStartingWindowListener.setTransitionManager(this);
            SystemUiProxy.INSTANCE.get(mLauncher).setStartingWindowListener(
                    new IStartingWindowListener.Stub() {
                        @Override
                        public void onTaskLaunching(int taskId, int supportedType) {
                            mTypeForTaskId.put(taskId, supportedType);
                        }
                    });
                    mStartingWindowListener);
        }
    }

@@ -819,6 +817,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
    public void onActivityDestroyed() {
        unregisterRemoteAnimations();
        unregisterRemoteTransitions();
        mStartingWindowListener.setTransitionManager(null);
        SystemUiProxy.INSTANCE.getNoCreate().setStartingWindowListener(null);
    }

@@ -1240,4 +1239,17 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
            cropCenterYEnd = windowTargetBounds.centerY();
        }
    }

    private static class StartingWindowListener extends IStartingWindowListener.Stub {
        private QuickstepTransitionManager mTransitionManager;

        public void setTransitionManager(QuickstepTransitionManager transitionManager) {
            mTransitionManager = transitionManager;
        }

        @Override
        public void onTaskLaunching(int taskId, int supportedType) {
            mTransitionManager.mTypeForTaskId.put(taskId, supportedType);
        }
    }
}