Manage ref to transition manager from binder object am: ad41204946

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14297199

Change-Id: Ie545f949869fe7737dc514740fa93228cb44153d
This commit is contained in:
Winson Chung
2021-04-23 20:31:10 +00:00
committed by Automerger Merge Worker
@@ -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);
}
}
}