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

Commit 59b2e81d authored by Justin Weir's avatar Justin Weir
Browse files

Remove getShadeViewController calls

Bug: 288868098
Test: updated and ran affected test
Change-Id: Ie99aaf892fa20dbf9379e749ec83d384d973f038
parent 5d058911
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -133,6 +133,7 @@ import com.android.systemui.settings.DisplayTracker;
import com.android.systemui.settings.UserContextProvider;
import com.android.systemui.settings.UserTracker;
import com.android.systemui.shade.ShadeController;
import com.android.systemui.shade.ShadeViewController;
import com.android.systemui.shared.navigationbar.RegionSamplingHelper;
import com.android.systemui.shared.recents.utilities.Utilities;
import com.android.systemui.shared.rotation.RotationButton;
@@ -199,6 +200,7 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
    private final SysUiState mSysUiFlagsContainer;
    private final Lazy<Optional<CentralSurfaces>> mCentralSurfacesOptionalLazy;
    private final ShadeController mShadeController;
    private final ShadeViewController mShadeViewController;
    private final NotificationRemoteInputManager mNotificationRemoteInputManager;
    private final OverviewProxyService mOverviewProxyService;
    private final NavigationModeController mNavigationModeController;
@@ -523,6 +525,7 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
    @Inject
    NavigationBar(
            NavigationBarView navigationBarView,
            ShadeController shadeController,
            NavigationBarFrame navigationBarFrame,
            @Nullable Bundle savedState,
            @DisplayId Context context,
@@ -541,7 +544,7 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
            Optional<Pip> pipOptional,
            Optional<Recents> recentsOptional,
            Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy,
            ShadeController shadeController,
            ShadeViewController shadeViewController,
            NotificationRemoteInputManager notificationRemoteInputManager,
            NotificationShadeDepthController notificationShadeDepthController,
            @Main Handler mainHandler,
@@ -577,6 +580,7 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
        mSysUiFlagsContainer = sysUiFlagsContainer;
        mCentralSurfacesOptionalLazy = centralSurfacesOptionalLazy;
        mShadeController = shadeController;
        mShadeViewController = shadeViewController;
        mNotificationRemoteInputManager = notificationRemoteInputManager;
        mOverviewProxyService = overviewProxyService;
        mNavigationModeController = navigationModeController;
@@ -739,8 +743,7 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
        final Display display = mView.getDisplay();
        mView.setComponents(mRecentsOptional);
        if (mCentralSurfacesOptionalLazy.get().isPresent()) {
            mView.setComponents(
                    mCentralSurfacesOptionalLazy.get().get().getShadeViewController());
            mView.setComponents(mShadeViewController);
        }
        mView.setDisabledFlags(mDisabledFlags1, mSysUiFlagsContainer);
        mView.setOnVerticalChangedListener(this::onVerticalChanged);
@@ -1341,9 +1344,10 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
    }

    private void onVerticalChanged(boolean isVertical) {
        Optional<CentralSurfaces> cs = mCentralSurfacesOptionalLazy.get();
        if (cs.isPresent() && cs.get().getShadeViewController() != null) {
            cs.get().getShadeViewController().setQsScrimEnabled(!isVertical);
        // This check can probably be safely removed. It only remained to reduce regression
        // risk for a broad change that removed the CentralSurfaces reference in the if block
        if (mCentralSurfacesOptionalLazy.get().isPresent()) {
            mShadeViewController.setQsScrimEnabled(!isVertical);
        }
    }

+3 −1
Original line number Diff line number Diff line
@@ -94,6 +94,7 @@ import com.android.systemui.settings.UserContextProvider;
import com.android.systemui.settings.UserTracker;
import com.android.systemui.shade.NotificationShadeWindowView;
import com.android.systemui.shade.ShadeController;
import com.android.systemui.shade.ShadeViewController;
import com.android.systemui.shared.rotation.RotationButtonController;
import com.android.systemui.shared.system.TaskStackChangeListeners;
import com.android.systemui.statusbar.CommandQueue;
@@ -467,6 +468,7 @@ public class NavigationBarTest extends SysuiTestCase {
        when(deviceProvisionedController.isDeviceProvisioned()).thenReturn(true);
        return spy(new NavigationBar(
                mNavigationBarView,
                mock(ShadeController.class),
                mNavigationBarFrame,
                null,
                context,
@@ -485,7 +487,7 @@ public class NavigationBarTest extends SysuiTestCase {
                Optional.of(mock(Pip.class)),
                Optional.of(mock(Recents.class)),
                () -> Optional.of(mCentralSurfaces),
                mock(ShadeController.class),
                mock(ShadeViewController.class),
                mock(NotificationRemoteInputManager.class),
                mock(NotificationShadeDepthController.class),
                mHandler,