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

Commit 9e3fa103 authored by Lucas Dupin's avatar Lucas Dupin
Browse files

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)
parent 62c98601
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1955,7 +1955,7 @@
    <string name="config_dozeLongPressSensorType" translatable="false"></string>

    <!-- Control whether the always on display mode is available. This should only be enabled on
         devices where the display has be tuned to be power efficient in DOZE and/or DOZE_SUSPEND
         devices where the display has been tuned to be power efficient in DOZE and/or DOZE_SUSPEND
         states. -->
    <bool name="config_dozeAlwaysOnDisplayAvailable">false</bool>

+1 −4
Original line number Diff line number Diff line
@@ -250,10 +250,7 @@
    <string name="doze_brightness_sensor_type" translatable="false"></string>

    <!-- Doze: pulse parameter - how long does it take to fade in? -->
    <integer name="doze_pulse_duration_in">900</integer>

    <!-- Doze: pulse parameter - how long does it take to fade in after a pickup? -->
    <integer name="doze_pulse_duration_in_pickup">130</integer>
    <integer name="doze_pulse_duration_in">130</integer>

    <!-- Doze: pulse parameter - once faded in, how long does it stay visible? -->
    <integer name="doze_pulse_duration_visible">6000</integer>
+1 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@
    <item type="id" name="qs_icon_tag"/>
    <item type="id" name="qs_slash_tag"/>
    <item type="id" name="scrim"/>
    <item type="id" name="scrim_blanking"/>
    <item type="id" name="scrim_target"/>
    <item type="id" name="scrim_alpha_start"/>
    <item type="id" name="scrim_alpha_end"/>
+4 −3
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import com.android.systemui.Dependency.DependencyProvider;
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 class SystemUIFactory {

    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,
+0 −1
Original line number Diff line number Diff line
@@ -35,7 +35,6 @@ public interface DozeHost {
    boolean isBlockingDoze();

    void startPendingIntentDismissingKeyguard(PendingIntent intent);
    void abortPulsing();
    void extendPulse();

    void setAnimateWakeup(boolean animateWakeup);
Loading