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 Original line Diff line number Diff line
@@ -2053,7 +2053,6 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
        mView.animate().cancel();
        mView.animate().cancel();
    }
    }


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


    @Override
    public void expand(boolean animate) {
    public void expand(boolean animate) {
        if (isFullyCollapsed() || isCollapsing()) {
        if (isFullyCollapsed() || isCollapsing()) {
            mInstantExpanding = true;
            mInstantExpanding = true;
+0 −6
Original line number Original line Diff line number Diff line
@@ -31,12 +31,6 @@ import java.util.function.Consumer
 * @see NotificationPanelViewController
 * @see NotificationPanelViewController
 */
 */
interface ShadeViewController {
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. */
    /** Returns whether the shade is expanding or collapsing itself or quick settings. */
    val isExpandingOrCollapsing: Boolean
    val isExpandingOrCollapsing: Boolean


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