summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorAran Ink <nesciosquid@google.com>2020-04-21 17:53:41 -0400
committerAran Ink <nesciosquid@google.com>2020-04-24 18:06:14 -0400
commitd397b9084dfcd650cefa0454855dc1c8f3233573 (patch)
treed57ad44c24cd3f884d0e29f13dc2671361ea68e0 /core/java/android
parent8f0b08f1785d9c57ab9499be34043e58338f77d9 (diff)
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
Diffstat (limited to 'core/java/android')
-rwxr-xr-xcore/java/android/widget/ListPopupWindow.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/java/android/widget/ListPopupWindow.java b/core/java/android/widget/ListPopupWindow.java
index 6425cf11ccb3..4311ffbe0e95 100755
--- a/core/java/android/widget/ListPopupWindow.java
+++ b/core/java/android/widget/ListPopupWindow.java
@@ -746,6 +746,15 @@ public class ListPopupWindow implements ShowableListMenu {
}
/**
+ * 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.
*
* @param listener Listener that will be notified when the popup is dismissed.