Merge "Fix leakage of DisplayContent referenced from TransitionController" into sc-v2-dev am: c89faed0bd am: f779323d35

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16660805

Change-Id: I0f3ff1c86613fe472dcaa4d95ac1dbae5357ca78
This commit is contained in:
Riddle Hsu
2022-01-19 05:33:55 +00:00
committed by Automerger Merge Worker
4 changed files with 6 additions and 2 deletions

View File

@@ -1050,8 +1050,6 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
mAppTransition = new AppTransition(mWmService.mContext, mWmService, this);
mAppTransition.registerListenerLocked(mWmService.mActivityManagerAppTransitionNotifier);
mTransitionController.registerLegacyListener(
mWmService.mActivityManagerAppTransitionNotifier);
mAppTransition.registerListenerLocked(mFixedRotationTransitionListener);
mAppTransitionController = new AppTransitionController(mWmService, this);
mUnknownAppVisibilityController = new UnknownAppVisibilityController(mWmService, this);

View File

@@ -2851,6 +2851,7 @@ public class DisplayPolicy {
}
void release() {
mDisplayContent.mTransitionController.unregisterLegacyListener(mAppTransitionListener);
mHandler.post(mGestureNavigationSettingsObserver::unregister);
mImmersiveModeConfirmation.release();
}

View File

@@ -462,6 +462,10 @@ class TransitionController {
mLegacyListeners.add(listener);
}
void unregisterLegacyListener(WindowManagerInternal.AppTransitionListener listener) {
mLegacyListeners.remove(listener);
}
void dispatchLegacyAppTransitionPending() {
for (int i = 0; i < mLegacyListeners.size(); ++i) {
mLegacyListeners.get(i).onAppTransitionPendingLocked();

View File

@@ -139,6 +139,7 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub
void setWindowManager(WindowManagerService wms) {
mTransitionController = new TransitionController(mService, wms.mTaskSnapshotController);
mTransitionController.registerLegacyListener(wms.mActivityManagerAppTransitionNotifier);
}
TransitionController getTransitionController() {