Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e4ebbcc1 authored by Aran Ink's avatar Aran Ink Committed by Automerger Merge Worker
Browse files

Merge "Add dismissImmediate to ListPopupWindow to prevent window leaks in...

Merge "Add dismissImmediate to ListPopupWindow to prevent window leaks in GlobalActionsDialog." into rvc-dev am: 82e98727 am: 1b6a93a2

Change-Id: I15a037d60039321f056aa453dddb2e2b7959eb60
parents af53a39c 1b6a93a2
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -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.
     *
+1 −1
Original line number Diff line number Diff line
@@ -536,7 +536,7 @@ class ControlsUiControllerImpl @Inject constructor (
    override fun hide() {
        Log.d(ControlsUiController.TAG, "hide()")
        hidden = true
        popup?.dismiss()
        popup?.dismissImmediate()
        activeDialog?.dismiss()
        ControlActionCoordinator.closeDialog()

+8 −5
Original line number Diff line number Diff line
@@ -484,8 +484,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener,
     */
    @VisibleForTesting
    protected int getMaxShownPowerItems() {
        // TODO: Overflow disabled on keyguard while we solve for touch blocking issues.
        if (shouldUseControlsLayout() && !mKeyguardShowing) {
        if (shouldUseControlsLayout()) {
            return mResources.getInteger(com.android.systemui.R.integer.power_menu_max_columns);
        } else {
            return Integer.MAX_VALUE;
@@ -2246,7 +2245,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener,
            mShowing = false;
            resetOrientation();
            dismissPanel();
            dismissOverflow();
            dismissOverflow(true);
            if (mControlsUiController != null) mControlsUiController.hide();
            mNotificationShadeWindowController.setForceHasTopUi(mHadTopUi);
            mDepthController.updateGlobalDialogVisibility(0, null /* view */);
@@ -2259,11 +2258,15 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener,
            }
        }

        private void dismissOverflow() {
        private void dismissOverflow(boolean immediate) {
            if (mOverflowPopup != null) {
                if (immediate) {
                    mOverflowPopup.dismissImmediate();
                } else {
                    mOverflowPopup.dismiss();
                }
            }
        }

        private void setRotationSuggestionsEnabled(boolean enabled) {
            try {