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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user