Refactoring ScrimController

ScrimController is now a state machine with tests.

The main motivation for refactoring this class was to
centralize ownership of the scrim state. Before, animations
could be triggered by StatusBar, StatusBarKeyguardViewManager
or DozeScrimController simultaneously, causing collision,
sometimes overriding an expected state due to the call order
and making it hard to calculate an actual state.

Change-Id: I4f4d82549235d3fc7be35b235a2668e70b956cb7
Fixes: 64397851
Fixes: 65688233
Bug: 64155983
Test: runtest -x tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java
Test: runtest -x tests/src/com/android/systemui/statusbar/phone/DozeScrimControllerTest.java
Test: unlock using fingerprint, or challenge (pin/password/pattern)
Test: trigger in-app bouncer (camera app)
Test: pull down notification shade locked and unlocked
Test: lock, look at AoD (or black display when AoD isn't supported)
diff --git a/packages/SystemUI/src/com/android/systemui/SystemUIFactory.java b/packages/SystemUI/src/com/android/systemui/SystemUIFactory.java
index 0c067ff..526a8f4 100644
--- a/packages/SystemUI/src/com/android/systemui/SystemUIFactory.java
+++ b/packages/SystemUI/src/com/android/systemui/SystemUIFactory.java
@@ -28,6 +28,7 @@
 import com.android.systemui.keyguard.DismissCallbackRegistry;
 import com.android.systemui.statusbar.KeyguardIndicationController;
 import com.android.systemui.statusbar.ScrimView;
+import com.android.systemui.statusbar.phone.DozeParameters;
 import com.android.systemui.statusbar.phone.KeyguardBouncer;
 import com.android.systemui.statusbar.phone.LightBarController;
 import com.android.systemui.statusbar.phone.LockIcon;
@@ -86,10 +87,10 @@
 
     public ScrimController createScrimController(LightBarController lightBarController,
             ScrimView scrimBehind, ScrimView scrimInFront, View headsUpScrim,
-            LockscreenWallpaper lockscreenWallpaper,
-            Consumer<Boolean> scrimVisibleListener) {
+            LockscreenWallpaper lockscreenWallpaper, Consumer<Boolean> scrimVisibleListener,
+            DozeParameters dozeParameters) {
         return new ScrimController(lightBarController, scrimBehind, scrimInFront, headsUpScrim,
-                scrimVisibleListener);
+                scrimVisibleListener, dozeParameters);
     }
 
     public NotificationIconAreaController createNotificationIconAreaController(Context context,