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

Commit 9bb05631 authored by Selim Cinek's avatar Selim Cinek
Browse files

Fixed a bug where the notifications would close on back

When the panel collapsing was aborted or couldn't close
because we were tracking, then the panel wouldn't be
focusable anymore so it wouldn't handle the back pressed
for example.

Change-Id: If88c0b08301dccf8c2dcd79df5239e12fc83cce5
Test: click back while expanding, click back again when expanding finished, observe collapsing.
Fixes: 33260393
parent e907911e
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -857,7 +857,7 @@ public abstract class PanelView extends FrameLayout {

    public void collapse(boolean delayed, float speedUpFactor) {
        if (DEBUG) logf("collapse: " + this);
        if (!isFullyCollapsed() && !mTracking && !mClosing) {
        if (canPanelBeCollapsed()) {
            cancelHeightAnimator();
            notifyExpandingStarted();

@@ -872,6 +872,10 @@ public abstract class PanelView extends FrameLayout {
        }
    }

    public boolean canPanelBeCollapsed() {
        return !isFullyCollapsed() && !mTracking && !mClosing;
    }

    private final Runnable mFlingCollapseRunnable = new Runnable() {
        @Override
        public void run() {
+6 −1
Original line number Diff line number Diff line
@@ -2891,7 +2891,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
            }
        }

        if (mStatusBarWindow != null) {
        if (mStatusBarWindow != null && mNotificationPanel.canPanelBeCollapsed()) {
            // release focus immediately to kick off focus change transition
            mStatusBarWindowManager.setStatusBarFocusable(false);

@@ -4622,6 +4622,11 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,

    public void onClosingFinished() {
        runPostCollapseRunnables();
        if (!isPanelFullyCollapsed()) {
            // if we set it not to be focusable when collapsing, we have to undo it when we aborted
            // the closing
            mStatusBarWindowManager.setStatusBarFocusable(true);
        }
    }

    public void onUnlockHintStarted() {