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

Commit a6f04afb authored by Robin Lee's avatar Robin Lee
Browse files

Tidy up PhoneStatusBar deeply nested Runnables

Change-Id: I07dae5fbe8360e467169e7d2d61492a804bcaf41
parent 9c5799c4
Loading
Loading
Loading
Loading
+39 −36
Original line number Diff line number Diff line
@@ -4654,11 +4654,20 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
            final Runnable clickPendingViewRunnable = new Runnable() {
                @Override
                public void run() {
                    if (mPendingWorkRemoteInputView != null) {
                    final View pendingWorkRemoteInputView = mPendingWorkRemoteInputView;
                    if (pendingWorkRemoteInputView == null) {
                        return;
                    }

                    // Climb up the hierarchy until we get to the container for this row.
                    ViewParent p = pendingWorkRemoteInputView.getParent();
                        while (p != null) {
                            if (p instanceof ExpandableNotificationRow) {
                    while (!(p instanceof ExpandableNotificationRow)) {
                        if (p == null) {
                            return;
                        }
                        p = p.getParent();
                    }

                    final ExpandableNotificationRow row = (ExpandableNotificationRow) p;
                    ViewParent viewParent = row.getParent();
                    if (viewParent instanceof NotificationStackScrollLayout) {
@@ -4668,8 +4677,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
                        row.post(new Runnable() {
                            @Override
                            public void run() {
                                            final Runnable finishScrollingCallback = new Runnable()
                                            {
                                final Runnable finishScrollingCallback = new Runnable() {
                                    @Override
                                    public void run() {
                                        mPendingWorkRemoteInputView.callOnClick();
@@ -4688,11 +4696,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
                            }
                        });
                    }
                                break;
                            }
                            p = p.getParent();
                        }
                    }
                }
            };
            mNotificationPanel.getViewTreeObserver().addOnGlobalLayoutListener(