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

Commit 9db6d509 authored by Justin Weir's avatar Justin Weir
Browse files

Remove expand and expandToQs from ShadeViewController

The only expand caller outside the legacy shade package can call
the ShadeController equivalent, which means it doesn't need to be
part of the interface. expandToQs is only called inside the shade
package in legacy code that directly reference NPVC instead of SVC.

Flag: ACONFIG com.android.systemui.scene_container DEVELOPMENT
Test: Updated and ran affected test
Bug: 303267342
Change-Id: I0ca2fe55c3f0d9fb12326b84c5d87b3de874df62
parent cb5c34af
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -2053,7 +2053,6 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
        mView.animate().cancel();
    }

    @Override
    public void expandToQs() {
        if (mQsController.isExpansionEnabled()) {
            mQsController.setExpandImmediate(true);
@@ -2820,7 +2819,6 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
        mQsController.setListening(listening);
    }

    @Override
    public void expand(boolean animate) {
        if (isFullyCollapsed() || isCollapsing()) {
            mInstantExpanding = true;
+0 −6
Original line number Diff line number Diff line
@@ -31,12 +31,6 @@ import java.util.function.Consumer
 * @see NotificationPanelViewController
 */
interface ShadeViewController {
    /** Expand the shade either animated or instantly. */
    fun expand(animate: Boolean)

    /** Animates to an expanded shade with QS expanded. If the shade starts expanded, expands QS. */
    fun expandToQs()

    /** Returns whether the shade is expanding or collapsing itself or quick settings. */
    val isExpandingOrCollapsing: Boolean

+0 −2
Original line number Diff line number Diff line
@@ -28,8 +28,6 @@ import javax.inject.Inject
/** Empty implementation of ShadeViewController for variants with no shade. */
class ShadeViewControllerEmptyImpl @Inject constructor() :
    ShadeViewController, ShadeBackActionInteractor, ShadeLockscreenInteractor {
    override fun expand(animate: Boolean) {}
    override fun expandToQs() {}
    override fun expandToNotifications() {}
    override val isExpandingOrCollapsing: Boolean = false
    override val isExpanded: Boolean = false
+1 −1
Original line number Diff line number Diff line
@@ -309,7 +309,7 @@ public class CentralSurfacesCommandQueueCallbacks implements CommandQueue.Callba
                if (mVibrateOnOpening) {
                    vibrateOnNavigationKeyDown();
                }
                mShadeViewController.expand(true /* animate */);
                mShadeController.animateExpandShade();
                mNotificationStackScrollLayoutController.setWillExpand(true);
                mHeadsUpManager.unpinAll(true /* userUnpinned */);
                mMetricsLogger.count("panel_open", 1);
+1 −1
Original line number Diff line number Diff line
@@ -91,7 +91,7 @@ private constructor(
                if (event.source == InputDevice.SOURCE_MOUSE) {
                    if (event.action == MotionEvent.ACTION_UP) {
                        v.performClick()
                        shadeViewController.expand(/* animate= */ true)
                        shadeController.animateExpandShade()
                    }
                    return true
                }
Loading