diff options
| author | 2023-11-14 14:49:31 +0100 | |
|---|---|---|
| committer | 2023-11-15 22:17:06 +0100 | |
| commit | 980ef67d0334235db4122d22ea2e048db1588600 (patch) | |
| tree | 27827e45eb7eea251ddf3f7a083a5ae82857653c | |
| parent | a6c9dae6b4fcf735a001a972c229af992cd30afa (diff) | |
Migrate LIGHT_REVEAL_MIGRATION to aconfig
Test: NONE
Bug: b/281655028
Flag: ACONFIG com.android.systemui.Flags.FLAG_LIGHT_REVEAL_MIGRATION DEVELOPMENT
Change-Id: I68f6241c189b135be4fade14dbda6c131903610e
5 files changed, 20 insertions, 19 deletions
diff --git a/packages/SystemUI/aconfig/systemui.aconfig b/packages/SystemUI/aconfig/systemui.aconfig index d0b471a75327..4cb360392c64 100644 --- a/packages/SystemUI/aconfig/systemui.aconfig +++ b/packages/SystemUI/aconfig/systemui.aconfig @@ -126,4 +126,11 @@ flag { namespace: "systemui" description: "New LOCKSCREEN <=> AOD transition" bug: "301915812" +} + +flag { + name: "light_reveal_migration" + namespace: "systemui" + description: "Move LightRevealScrim to recommended architecture" + bug: "281655028" }
\ No newline at end of file diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/AuthRippleController.kt b/packages/SystemUI/src/com/android/systemui/biometrics/AuthRippleController.kt index f94f8c594aa6..634531215002 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/AuthRippleController.kt +++ b/packages/SystemUI/src/com/android/systemui/biometrics/AuthRippleController.kt @@ -31,11 +31,11 @@ import com.android.keyguard.KeyguardUpdateMonitorCallback import com.android.keyguard.logging.KeyguardLogger import com.android.settingslib.Utils import com.android.systemui.CoreStartable +import com.android.systemui.Flags.lightRevealMigration import com.android.systemui.res.R import com.android.systemui.biometrics.shared.model.UdfpsOverlayParams import com.android.systemui.dagger.SysUISingleton import com.android.systemui.flags.FeatureFlags -import com.android.systemui.flags.Flags import com.android.systemui.keyguard.WakefulnessLifecycle import com.android.systemui.log.core.LogLevel import com.android.systemui.plugins.statusbar.StatusBarStateController @@ -191,7 +191,7 @@ class AuthRippleController @Inject constructor( // This code path is not used if the KeyguardTransitionRepository is managing the light // reveal scrim. - if (!featureFlags.isEnabled(Flags.LIGHT_REVEAL_MIGRATION)) { + if (!lightRevealMigration()) { if (statusBarStateController.isDozing || biometricUnlockController.isWakeAndUnlock) { circleReveal?.let { lightRevealScrim.revealAmount = 0f @@ -210,7 +210,7 @@ class AuthRippleController @Inject constructor( } override fun onKeyguardFadingAwayChanged() { - if (featureFlags.isEnabled(Flags.LIGHT_REVEAL_MIGRATION)) { + if (lightRevealMigration()) { return } diff --git a/packages/SystemUI/src/com/android/systemui/flags/Flags.kt b/packages/SystemUI/src/com/android/systemui/flags/Flags.kt index 39aa2be247ec..00f32efd066d 100644 --- a/packages/SystemUI/src/com/android/systemui/flags/Flags.kt +++ b/packages/SystemUI/src/com/android/systemui/flags/Flags.kt @@ -148,14 +148,6 @@ object Flags { // TODO(b/255607168): Tracking Bug @JvmField val DOZING_MIGRATION_1 = unreleasedFlag("dozing_migration_1") - /** - * Migrates control of the LightRevealScrim's reveal effect and amount from legacy code to the - * new KeyguardTransitionRepository. - */ - // TODO(b/281655028): Tracking bug - @JvmField - val LIGHT_REVEAL_MIGRATION = unreleasedFlag("light_reveal_migration", teamfood = true) - // TODO(b/305984787): @JvmField val REFACTOR_GETCURRENTUSER = unreleasedFlag("refactor_getcurrentuser", teamfood = true) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java index 46675c2889d8..4cb01e12ea8b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java @@ -27,6 +27,7 @@ import static androidx.core.view.ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_ import static androidx.lifecycle.Lifecycle.State.RESUMED; import static com.android.systemui.Dependency.TIME_TICK_HANDLER_NAME; +import static com.android.systemui.Flags.lightRevealMigration; import static com.android.systemui.charging.WirelessChargingAnimation.UNKNOWN_BATTERY_LEVEL; import static com.android.systemui.statusbar.NotificationLockscreenUserManager.PERMISSION_SELF; import static com.android.systemui.statusbar.StatusBarState.SHADE; @@ -239,6 +240,8 @@ import com.android.wm.shell.startingsurface.StartingSurface; import dalvik.annotation.optimization.NeverCompile; +import dagger.Lazy; + import java.io.PrintWriter; import java.io.StringWriter; import java.util.List; @@ -250,8 +253,6 @@ import javax.inject.Inject; import javax.inject.Named; import javax.inject.Provider; -import dagger.Lazy; - /** * A class handling initialization and coordination between some of the key central surfaces in * System UI: The notification shade, the keyguard (lockscreen), and the status bar. @@ -953,7 +954,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { @Override public void onKeyguardGoingAwayChanged() { - if (mFeatureFlags.isEnabled(Flags.LIGHT_REVEAL_MIGRATION)) { + if (lightRevealMigration()) { // This code path is not used if the KeyguardTransitionRepository is managing // the lightreveal scrim. return; @@ -1222,7 +1223,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { }); mScrimController.attachViews(scrimBehind, notificationsScrim, scrimInFront); - if (mFeatureFlags.isEnabled(Flags.LIGHT_REVEAL_MIGRATION)) { + if (lightRevealMigration()) { LightRevealScrimViewBinder.bind( mLightRevealScrim, mLightRevealScrimViewModelLazy.get()); } @@ -2355,7 +2356,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { return; } - if (mFeatureFlags.isEnabled(Flags.LIGHT_REVEAL_MIGRATION)) { + if (lightRevealMigration()) { return; } @@ -3001,7 +3002,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { return; } - if (!mFeatureFlags.isEnabled(Flags.LIGHT_REVEAL_MIGRATION)) { + if (!lightRevealMigration()) { mLightRevealScrim.setAlpha(mScrimController.getState().getMaxLightRevealScrimAlpha()); } } @@ -3156,7 +3157,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { @Override public void onDozeAmountChanged(float linear, float eased) { - if (!mFeatureFlags.isEnabled(Flags.LIGHT_REVEAL_MIGRATION) + if (!lightRevealMigration() && !(mLightRevealScrim.getRevealEffect() instanceof CircleReveal)) { mLightRevealScrim.setRevealAmount(1f - linear); } diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java index 6570724523bc..ebdff082b7b3 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java @@ -23,6 +23,7 @@ import static android.app.StatusBarManager.WINDOW_STATE_SHOWING; import static android.provider.Settings.Global.HEADS_UP_NOTIFICATIONS_ENABLED; import static android.provider.Settings.Global.HEADS_UP_ON; +import static com.android.systemui.Flags.FLAG_LIGHT_REVEAL_MIGRATION; import static com.android.systemui.statusbar.StatusBarState.KEYGUARD; import static com.android.systemui.statusbar.StatusBarState.SHADE; @@ -349,7 +350,7 @@ public class CentralSurfacesImplTest extends SysuiTestCase { mFeatureFlags.set(Flags.WM_SHADE_ALLOW_BACK_GESTURE, true); // For the Shade to animate during the Back gesture, we must enable the animation flag. mFeatureFlags.set(Flags.WM_SHADE_ANIMATE_BACK_GESTURE, true); - mFeatureFlags.set(Flags.LIGHT_REVEAL_MIGRATION, true); + mSetFlagsRule.enableFlags(FLAG_LIGHT_REVEAL_MIGRATION); // Turn AOD on and toggle feature flag for jank fixes mFeatureFlags.set(Flags.ZJ_285570694_LOCKSCREEN_TRANSITION_FROM_AOD, true); when(mDozeParameters.getAlwaysOn()).thenReturn(true); |