Add dismissImmediate to ListPopupWindow to prevent window leaks in GlobalActionsDialog.

Fixes: 154640131
Test: Manual -- Use 'adb shell dumpsys window windows || grep "PopupWindow"' to confirm number of PopupWindows displayed (should be zero at home screen.)
Open GlobalActions. Tap the power overflow menu and check number of PopupWindows while the overflow dropdown is visible (should be 1).
Put the phone to sleep by pressing the power button. Wake phone and make sure number of PopupWindows is 0.
Repeat with Controls structure switcher dropdown and add controls dropdown.

Change-Id: I4ae2d86e981465e8e6c0adf924a6fc2eabfc88ee
This commit is contained in:
Aran Ink
2020-04-21 17:53:41 -04:00
parent 8f0b08f178
commit d397b9084d
3 changed files with 18 additions and 6 deletions

View File

@@ -745,6 +745,15 @@ public class ListPopupWindow implements ShowableListMenu {
mHandler.removeCallbacks(mResizePopupRunnable);
}
/**
* Remove existing exit transition from PopupWindow and force immediate dismissal.
* @hide
*/
public void dismissImmediate() {
mPopup.setExitTransition(null);
dismiss();
}
/**
* Set a listener to receive a callback when the popup is dismissed.
*