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

Commit 32bfe882 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fixed an issue where the collapsing was called on the wrong thread"

parents 17df7fe1 52d3dfd2
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -4985,7 +4985,7 @@ public class StatusBar extends SystemUI implements DemoMode,
                                    notificationKey)) {
                                // Show work challenge, do not run PendingIntent and
                                // remove notification
                                collapsePanel();
                                collapseOnMainThread();
                                return;
                            }
                        }
@@ -5026,11 +5026,7 @@ public class StatusBar extends SystemUI implements DemoMode,
                    }
                }
                if (shouldCollapse()) {
                    if (Looper.getMainLooper().isCurrentThread()) {
                        collapsePanel();
                    } else {
                        mStackScroller.post(this::collapsePanel);
                    }
                    collapseOnMainThread();
                }

                try {
@@ -5058,6 +5054,14 @@ public class StatusBar extends SystemUI implements DemoMode,
        }, afterKeyguardGone);
    }

    private void collapseOnMainThread() {
        if (Looper.getMainLooper().isCurrentThread()) {
            collapsePanel();
        } else {
            mStackScroller.post(this::collapsePanel);
        }
    }

    private boolean shouldCollapse() {
        return mState != StatusBarState.SHADE || !mActivityLaunchAnimator.isAnimationPending();
    }