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

Commit 1eb42ed4 authored by Justin Weir's avatar Justin Weir
Browse files

Begin decoupling CentralSurfaces and NPVC

Removed 6 methods from the CentralSurfaces API that were either
redundant or merely passthroughs to NPVC.

Fixes: 254875405
Bug: 249277686
Test: atest and manual
Change-Id: Ie76c44d6dd290eab44a58937326ff075608cb927
parent 55331d3f
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -680,7 +680,8 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
        final Display display = mView.getDisplay();
        mView.setComponents(mRecentsOptional);
        if (mCentralSurfacesOptionalLazy.get().isPresent()) {
            mView.setComponents(mCentralSurfacesOptionalLazy.get().get().getPanelController());
            mView.setComponents(
                    mCentralSurfacesOptionalLazy.get().get().getNotificationPanelViewController());
        }
        mView.setDisabledFlags(mDisabledFlags1, mSysUiFlagsContainer);
        mView.setOnVerticalChangedListener(this::onVerticalChanged);
@@ -1257,8 +1258,8 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
    }

    private void onVerticalChanged(boolean isVertical) {
        mCentralSurfacesOptionalLazy.get().ifPresent(
                statusBar -> statusBar.setQsScrimEnabled(!isVertical));
        mCentralSurfacesOptionalLazy.get().ifPresent(statusBar ->
                statusBar.getNotificationPanelViewController().setQsScrimEnabled(!isVertical));
    }

    private boolean onNavigationTouch(View v, MotionEvent event) {
+3 −2
Original line number Diff line number Diff line
@@ -190,7 +190,8 @@ public class OverviewProxyService extends CurrentUserTracker implements
                // TODO move this logic to message queue
                mCentralSurfacesOptionalLazy.get().ifPresent(centralSurfaces -> {
                    if (event.getActionMasked() == ACTION_DOWN) {
                        centralSurfaces.getPanelController().startExpandLatencyTracking();
                        centralSurfaces.getNotificationPanelViewController()
                                        .startExpandLatencyTracking();
                    }
                    mHandler.post(() -> {
                        int action = event.getActionMasked();
@@ -614,7 +615,7 @@ public class OverviewProxyService extends CurrentUserTracker implements
        final NavigationBarView navBarView =
                mNavBarControllerLazy.get().getNavigationBarView(mContext.getDisplayId());
        final NotificationPanelViewController panelController =
                mCentralSurfacesOptionalLazy.get().get().getPanelController();
                mCentralSurfacesOptionalLazy.get().get().getNotificationPanelViewController();
        if (SysUiState.DEBUG) {
            Log.d(TAG_OPS, "Updating sysui state flags: navBarFragment=" + navBarFragment
                    + " navBarView=" + navBarView + " panelController=" + panelController);
+8 −9
Original line number Diff line number Diff line
@@ -531,7 +531,7 @@ public final class NotificationPanelViewController {
    private final NavigationBarController mNavigationBarController;
    private final int mDisplayId;

    private KeyguardIndicationController mKeyguardIndicationController;
    private final KeyguardIndicationController mKeyguardIndicationController;
    private int mHeadsUpInset;
    private boolean mHeadsUpPinnedMode;
    private boolean mAllowExpandForSmallExpansion;
@@ -743,6 +743,7 @@ public final class NotificationPanelViewController {
            SysUiState sysUiState,
            Provider<KeyguardBottomAreaViewController> keyguardBottomAreaViewControllerProvider,
            KeyguardUnlockAnimationController keyguardUnlockAnimationController,
            KeyguardIndicationController keyguardIndicationController,
            NotificationListContainer notificationListContainer,
            NotificationStackSizeCalculator notificationStackSizeCalculator,
            UnlockedScreenOffAnimationController unlockedScreenOffAnimationController,
@@ -779,6 +780,7 @@ public final class NotificationPanelViewController {

        mResources = mView.getResources();
        mKeyguardStateController = keyguardStateController;
        mKeyguardIndicationController = keyguardIndicationController;
        mStatusBarStateController = (SysuiStatusBarStateController) statusBarStateController;
        mNotificationShadeWindowController = notificationShadeWindowController;
        FlingAnimationUtils.Builder fauBuilder = flingAnimationUtilsBuilder.get();
@@ -1020,7 +1022,7 @@ public final class NotificationPanelViewController {
        mNotificationStackScrollLayoutController.setOnEmptySpaceClickListener(
                mOnEmptySpaceClickListener);
        addTrackingHeadsUpListener(mNotificationStackScrollLayoutController::setTrackingHeadsUp);
        mKeyguardBottomArea = mView.findViewById(R.id.keyguard_bottom_area);
        setKeyguardBottomArea(mView.findViewById(R.id.keyguard_bottom_area));

        initBottomArea();

@@ -1264,7 +1266,7 @@ public final class NotificationPanelViewController {
        int index = mView.indexOfChild(mKeyguardBottomArea);
        mView.removeView(mKeyguardBottomArea);
        KeyguardBottomAreaView oldBottomArea = mKeyguardBottomArea;
        mKeyguardBottomArea = mKeyguardBottomAreaViewControllerProvider.get().getView();
        setKeyguardBottomArea(mKeyguardBottomAreaViewControllerProvider.get().getView());
        mKeyguardBottomArea.initFrom(oldBottomArea);
        mView.addView(mKeyguardBottomArea, index);
        initBottomArea();
@@ -1343,8 +1345,8 @@ public final class NotificationPanelViewController {
        return mHintAnimationRunning || mUnlockedScreenOffAnimationController.isAnimationPlaying();
    }

    public void setKeyguardIndicationController(KeyguardIndicationController indicationController) {
        mKeyguardIndicationController = indicationController;
    private void setKeyguardBottomArea(KeyguardBottomAreaView keyguardBottomArea) {
        mKeyguardBottomArea = keyguardBottomArea;
        mKeyguardIndicationController.setIndicationArea(mKeyguardBottomArea);
    }

@@ -3880,6 +3882,7 @@ public final class NotificationPanelViewController {

    public void setHeadsUpManager(HeadsUpManagerPhone headsUpManager) {
        mHeadsUpManager = headsUpManager;
        mHeadsUpManager.addListener(mOnHeadsUpChangedListener);
        mHeadsUpTouchHelper = new HeadsUpTouchHelper(headsUpManager,
                mNotificationStackScrollLayoutController.getHeadsUpCallback(),
                NotificationPanelViewController.this);
@@ -4361,10 +4364,6 @@ public final class NotificationPanelViewController {
        mView.getViewTreeObserver().removeOnGlobalLayoutListener(listener);
    }

    public ShadeHeadsUpChangedListener getOnHeadsUpChangedListener() {
        return mOnHeadsUpChangedListener;
    }

    public void setHeaderDebugInfo(String text) {
        if (DEBUG_DRAWABLE) mHeaderDebugInfo = text;
    }
+1 −1
Original line number Diff line number Diff line
@@ -224,6 +224,6 @@ public class ShadeControllerImpl implements ShadeController {
    }

    private NotificationPanelViewController getNotificationPanelViewController() {
        return getCentralSurfaces().getPanelController();
        return getCentralSurfaces().getNotificationPanelViewController();
    }
}
+0 −13
Original line number Diff line number Diff line
@@ -196,8 +196,6 @@ public interface CentralSurfaces extends Dumpable, ActivityStarter, LifecycleOwn

    void collapsePanelOnMainThread();

    void collapsePanelWithDuration(int duration);

    void togglePanel();

    void start();
@@ -305,9 +303,6 @@ public interface CentralSurfaces extends Dumpable, ActivityStarter, LifecycleOwn

    void checkBarModes();

    // Called by NavigationBarFragment
    void setQsScrimEnabled(boolean scrimEnabled);

    void updateBubblesVisibility();

    void setInteracting(int barWindow, boolean interacting);
@@ -379,8 +374,6 @@ public interface CentralSurfaces extends Dumpable, ActivityStarter, LifecycleOwn

    void showKeyguardImpl();

    boolean isInLaunchTransition();

    void fadeKeyguardAfterLaunchTransition(Runnable beforeFading,
            Runnable endRunnable, Runnable cancelRunnable);

@@ -437,8 +430,6 @@ public interface CentralSurfaces extends Dumpable, ActivityStarter, LifecycleOwn

    void showPinningEscapeToast();

    KeyguardBottomAreaView getKeyguardBottomAreaView();

    void setBouncerShowing(boolean bouncerShowing);

  void setBouncerShowingOverDream(boolean bouncerShowingOverDream);
@@ -505,12 +496,8 @@ public interface CentralSurfaces extends Dumpable, ActivityStarter, LifecycleOwn

    boolean isBouncerShowingOverDream();

    void onBouncerPreHideAnimation();

    boolean isKeyguardSecure();

    NotificationPanelViewController getPanelController();

    NotificationGutsManager getGutsManager();

    void updateNotificationPanelTouchState();
Loading