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

Commit b09c329a authored by Shawn Lee's avatar Shawn Lee
Browse files

Removed calls to NPVC.getView()

Got rid of most NPVC.getView calls except for the ones
in FoldAodAnimationController, to get closer to deleting it entirely.

Bug: 254878364
Test: existing tests
Change-Id: If8070d9ec766e7116178febd23cb3f9910d5affb
parent d7d2d977
Loading
Loading
Loading
Loading
+23 −3
Original line number Diff line number Diff line
@@ -672,7 +672,7 @@ public final class NotificationPanelViewController implements Dumpable {
    };
    private final Runnable mMaybeHideExpandedRunnable = () -> {
        if (getExpansionFraction() == 0.0f) {
            getView().post(mHideExpandedRunnable);
            postToView(mHideExpandedRunnable);
        }
    };

@@ -2779,7 +2779,7 @@ public final class NotificationPanelViewController implements Dumpable {
            return top + mNotificationStackScrollLayoutController.getHeight()
                    + mSplitShadeNotificationsScrimMarginBottom;
        } else {
            return getView().getBottom();
            return mView.getBottom();
        }
    }

@@ -2794,7 +2794,7 @@ public final class NotificationPanelViewController implements Dumpable {

    private int calculateRightQsClippingBound() {
        if (mIsFullWidth) {
            return getView().getRight() + mDisplayRightInset;
            return mView.getRight() + mDisplayRightInset;
        } else {
            return mNotificationStackScrollLayoutController.getRight();
        }
@@ -5162,6 +5162,26 @@ public final class NotificationPanelViewController implements Dumpable {
        return mView;
    }

    /** */
    public boolean postToView(Runnable action) {
        return mView.post(action);
    }

    /** */
    public boolean sendInterceptTouchEventToView(MotionEvent event) {
        return mView.onInterceptTouchEvent(event);
    }

    /** */
    public void requestLayoutOnView() {
        mView.requestLayout();
    }

    /** */
    public void resetViewAlphas() {
        ViewGroupFadeHelper.reset(mView);
    }

    private void beginJankMonitoring() {
        if (mInteractionJankMonitor == null) {
            return;
+1 −1
Original line number Diff line number Diff line
@@ -311,7 +311,7 @@ public class NotificationShadeWindowViewController {
                MotionEvent cancellation = MotionEvent.obtain(ev);
                cancellation.setAction(MotionEvent.ACTION_CANCEL);
                mStackScrollLayout.onInterceptTouchEvent(cancellation);
                mNotificationPanelViewController.getView().onInterceptTouchEvent(cancellation);
                mNotificationPanelViewController.sendInterceptTouchEventToView(cancellation);
                cancellation.recycle();
            }

+1 −1
Original line number Diff line number Diff line
@@ -160,7 +160,7 @@ public class ShadeControllerImpl implements ShadeController {
                        if (getCentralSurfaces().getNotificationShadeWindowView()
                                .isVisibleToUser()) {
                            getNotificationPanelViewController().removeOnGlobalLayoutListener(this);
                            getNotificationPanelViewController().getView().post(executable);
                            getNotificationPanelViewController().postToView(executable);
                        }
                    }
                });
+2 −2
Original line number Diff line number Diff line
@@ -72,9 +72,9 @@ public class StatusBarHeadsUpChangeListener implements OnHeadsUpChangedListener
                //resize the layout. Let's
                // make sure that the window stays small for one frame until the
                //touchableRegion is set.
                mNotificationPanelViewController.getView().requestLayout();
                mNotificationPanelViewController.requestLayoutOnView();
                mNotificationShadeWindowController.setForceWindowCollapsed(true);
                mNotificationPanelViewController.getView().post(() -> {
                mNotificationPanelViewController.postToView(() -> {
                    mNotificationShadeWindowController.setForceWindowCollapsed(false);
                });
            }
+1 −2
Original line number Diff line number Diff line
@@ -77,7 +77,6 @@ import com.android.systemui.statusbar.NotificationShadeWindowController;
import com.android.systemui.statusbar.RemoteInputController;
import com.android.systemui.statusbar.StatusBarState;
import com.android.systemui.statusbar.SysuiStatusBarStateController;
import com.android.systemui.statusbar.notification.ViewGroupFadeHelper;
import com.android.systemui.statusbar.phone.KeyguardBouncer.PrimaryBouncerExpansionCallback;
import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.statusbar.policy.KeyguardStateController;
@@ -1009,7 +1008,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
    public void onKeyguardFadedAway() {
        mNotificationContainer.postDelayed(() -> mNotificationShadeWindowController
                        .setKeyguardFadingAway(false), 100);
        ViewGroupFadeHelper.reset(mNotificationPanelViewController.getView());
        mNotificationPanelViewController.resetViewAlphas();
        mCentralSurfaces.finishKeyguardFadingAway();
        mBiometricUnlockController.finishKeyguardFadingAway();
        WindowManagerGlobal.getInstance().trimMemory(
Loading