Manage ref to transition manager from binder object

Bug: 186121207
Test: Presubmit
Change-Id: I14735708f1368e2b008e1e8d44273d569219e5df
This commit is contained in:
Winson Chung
2021-04-23 10:48:17 -07:00
parent 199c1850fb
commit ad41204946

View File

@@ -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);
}
}
}