Add empty implementation of ShadeController

Variants without shades want this, so there should be only one, and
it should be in the shade package to make updates not require topics.
Also adds some default methods to ShadeController to reduce the size
of ShadeControllerEmptyImpl and deemphasize ShadeController methods
that are too tied to implementation details of ShadeControllerImpl.

Test: presubmits are sufficient
Bug: 288867586
Change-Id: Ia7015378f85a8a68db049069b2d678b57c4390b1
diff --git a/packages/SystemUI/src/com/android/systemui/shade/ShadeController.java b/packages/SystemUI/src/com/android/systemui/shade/ShadeController.java
index 317d885..ebb9888 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/ShadeController.java
+++ b/packages/SystemUI/src/com/android/systemui/shade/ShadeController.java
@@ -18,6 +18,7 @@
 
 import android.view.MotionEvent;
 
+import com.android.systemui.statusbar.CommandQueue;
 import com.android.systemui.statusbar.NotificationPresenter;
 import com.android.systemui.statusbar.StatusBarState;
 import com.android.systemui.statusbar.phone.CentralSurfaces;
@@ -39,16 +40,24 @@
     void instantCollapseShade();
 
     /** See {@link #animateCollapseShade(int, boolean, boolean, float)}. */
-    void animateCollapseShade();
+    default void animateCollapseShade() {
+        animateCollapseShade(CommandQueue.FLAG_EXCLUDE_NONE);
+    }
 
     /** See {@link #animateCollapseShade(int, boolean, boolean, float)}. */
-    void animateCollapseShade(int flags);
+    default void animateCollapseShade(int flags) {
+        animateCollapseShade(flags, false, false, 1.0f);
+    }
 
     /** See {@link #animateCollapseShade(int, boolean, boolean, float)}. */
-    void animateCollapseShadeForced();
+    default void animateCollapseShadeForced() {
+        animateCollapseShade(CommandQueue.FLAG_EXCLUDE_NONE, true, false, 1.0f);
+    }
 
     /** See {@link #animateCollapseShade(int, boolean, boolean, float)}. */
-    void animateCollapseShadeForcedDelayed();
+    default void animateCollapseShadeForcedDelayed() {
+        animateCollapseShade(CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL, true, true, 1.0f);
+    }
 
     /**
      * Collapse the shade animated, showing the bouncer when on {@link StatusBarState#KEYGUARD} or
@@ -155,17 +164,17 @@
     void onLaunchAnimationEnd(boolean launchIsFullScreen);
 
     /** Sets the listener for when the visibility of the shade changes. */
-    void setVisibilityListener(ShadeVisibilityListener listener);
+    default void setVisibilityListener(ShadeVisibilityListener listener) {};
 
     /** */
-    void setNotificationPresenter(NotificationPresenter presenter);
+    default void setNotificationPresenter(NotificationPresenter presenter) {};
 
     /** */
-    void setNotificationShadeWindowViewController(
-            NotificationShadeWindowViewController notificationShadeWindowViewController);
+    default void setNotificationShadeWindowViewController(
+            NotificationShadeWindowViewController notificationShadeWindowViewController) {};
 
     /** */
-    void setShadeViewController(ShadeViewController shadeViewController);
+    default void setShadeViewController(ShadeViewController shadeViewController) {};
 
     /** Listens for shade visibility changes. */
     interface ShadeVisibilityListener {
diff --git a/packages/SystemUI/src/com/android/systemui/shade/ShadeControllerEmptyImpl.kt b/packages/SystemUI/src/com/android/systemui/shade/ShadeControllerEmptyImpl.kt
new file mode 100644
index 0000000..4d05007
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/shade/ShadeControllerEmptyImpl.kt
@@ -0,0 +1,52 @@
+package com.android.systemui.shade
+
+import android.view.MotionEvent
+import com.android.systemui.dagger.SysUISingleton
+import javax.inject.Inject
+
+/** Empty implementation of ShadeController for variants of Android without shades. */
+@SysUISingleton
+open class ShadeControllerEmptyImpl @Inject constructor() : ShadeController {
+    override fun instantExpandShade() {}
+    override fun instantCollapseShade() {}
+    override fun animateCollapseShade(
+        flags: Int,
+        force: Boolean,
+        delayed: Boolean,
+        speedUpFactor: Float
+    ) {}
+    override fun animateExpandShade() {}
+    override fun animateExpandQs() {}
+    override fun postAnimateCollapseShade() {}
+    override fun postAnimateForceCollapseShade() {}
+    override fun postAnimateExpandQs() {}
+    override fun cancelExpansionAndCollapseShade() {}
+    override fun closeShadeIfOpen(): Boolean {
+        return false
+    }
+    override fun isKeyguard(): Boolean {
+        return false
+    }
+    override fun isShadeFullyOpen(): Boolean {
+        return false
+    }
+    override fun isExpandingOrCollapsing(): Boolean {
+        return false
+    }
+    override fun postOnShadeExpanded(action: Runnable?) {}
+    override fun addPostCollapseAction(action: Runnable?) {}
+    override fun runPostCollapseRunnables() {}
+    override fun collapseShade(): Boolean {
+        return false
+    }
+    override fun collapseShade(animate: Boolean) {}
+    override fun collapseOnMainThread() {}
+    override fun makeExpandedInvisible() {}
+    override fun makeExpandedVisible(force: Boolean) {}
+    override fun isExpandedVisible(): Boolean {
+        return false
+    }
+    override fun onStatusBarTouch(event: MotionEvent?) {}
+    override fun onLaunchAnimationCancelled(isLaunchForActivity: Boolean) {}
+    override fun onLaunchAnimationEnd(launchIsFullScreen: Boolean) {}
+}
diff --git a/packages/SystemUI/src/com/android/systemui/shade/ShadeControllerImpl.java b/packages/SystemUI/src/com/android/systemui/shade/ShadeControllerImpl.java
index b92afac..af74a8d 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/ShadeControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/shade/ShadeControllerImpl.java
@@ -112,26 +112,6 @@
     }
 
     @Override
-    public void animateCollapseShade() {
-        animateCollapseShade(CommandQueue.FLAG_EXCLUDE_NONE);
-    }
-
-    @Override
-    public void animateCollapseShade(int flags) {
-        animateCollapseShade(flags, false, false, 1.0f);
-    }
-
-    @Override
-    public void animateCollapseShadeForced() {
-        animateCollapseShade(CommandQueue.FLAG_EXCLUDE_NONE, true, false, 1.0f);
-    }
-
-    @Override
-    public void animateCollapseShadeForcedDelayed() {
-        animateCollapseShade(CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL, true, true, 1.0f);
-    }
-
-    @Override
     public void animateCollapseShade(int flags, boolean force, boolean delayed,
             float speedUpFactor) {
         if (!force && mStatusBarStateController.getState() != StatusBarState.SHADE) {