Loading packages/SystemUI/src/com/android/systemui/flags/Flags.kt +5 −0 Original line number Diff line number Diff line Loading @@ -132,6 +132,11 @@ object Flags { // TODO(b/254512676): Tracking Bug @JvmField val LOCKSCREEN_CUSTOM_CLOCKS = releasedFlag(207, "lockscreen_custom_clocks") // TODO(b/275694445): Tracking Bug @JvmField val LOCKSCREEN_WITHOUT_SECURE_LOCK_WHEN_DREAMING = unreleasedFlag(208, "lockscreen_without_secure_lock_when_dreaming") /** * Whether the clock on a wide lock screen should use the new "stepping" animation for moving * the digits when the clock moves. Loading packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +14 −4 Original line number Diff line number Diff line Loading @@ -128,6 +128,8 @@ import com.android.systemui.classifier.FalsingCollector; import com.android.systemui.dagger.qualifiers.UiBackground; import com.android.systemui.dreams.DreamOverlayStateController; import com.android.systemui.dump.DumpManager; import com.android.systemui.flags.FeatureFlags; import com.android.systemui.flags.Flags; import com.android.systemui.keyguard.dagger.KeyguardModule; import com.android.systemui.navigationbar.NavigationModeController; import com.android.systemui.plugins.statusbar.StatusBarStateController; Loading Loading @@ -1185,6 +1187,8 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, private Lazy<ScrimController> mScrimControllerLazy; private IActivityTaskManager mActivityTaskManagerService; private FeatureFlags mFeatureFlags; /** * Injected constructor. See {@link KeyguardModule}. */ Loading Loading @@ -1216,7 +1220,8 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, Lazy<NotificationShadeWindowController> notificationShadeWindowControllerLazy, Lazy<ActivityLaunchAnimator> activityLaunchAnimator, Lazy<ScrimController> scrimControllerLazy, IActivityTaskManager activityTaskManagerService) { IActivityTaskManager activityTaskManagerService, FeatureFlags featureFlags) { mContext = context; mUserTracker = userTracker; mFalsingCollector = falsingCollector; Loading Loading @@ -1272,6 +1277,8 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, mDreamOpenAnimationDuration = (int) DREAMING_ANIMATION_DURATION_MS; mDreamCloseAnimationDuration = (int) LOCKSCREEN_ANIMATION_DURATION_MS; mFeatureFlags = featureFlags; } public void userActivity() { Loading Loading @@ -1685,14 +1692,17 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, } /** * A dream started. We should lock after the usual screen-off lock timeout but only * if there is a secure lock pattern. * A dream started. We should lock after the usual screen-off lock timeout regardless if * there is a secure lock pattern or not */ public void onDreamingStarted() { mUpdateMonitor.dispatchDreamingStarted(); synchronized (this) { final boolean alwaysShowKeyguard = mFeatureFlags.isEnabled(Flags.LOCKSCREEN_WITHOUT_SECURE_LOCK_WHEN_DREAMING); if (mDeviceInteractive && mLockPatternUtils.isSecure(KeyguardUpdateMonitor.getCurrentUser())) { && (alwaysShowKeyguard || mLockPatternUtils.isSecure(KeyguardUpdateMonitor.getCurrentUser()))) { doKeyguardLaterLocked(); } } Loading packages/SystemUI/src/com/android/systemui/keyguard/dagger/KeyguardModule.java +5 −2 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.dagger.qualifiers.UiBackground; import com.android.systemui.dreams.DreamOverlayStateController; import com.android.systemui.dump.DumpManager; import com.android.systemui.flags.FeatureFlags; import com.android.systemui.keyguard.DismissCallbackRegistry; import com.android.systemui.keyguard.KeyguardUnlockAnimationController; import com.android.systemui.keyguard.KeyguardViewMediator; Loading Loading @@ -121,7 +122,8 @@ public class KeyguardModule { Lazy<NotificationShadeWindowController> notificationShadeWindowController, Lazy<ActivityLaunchAnimator> activityLaunchAnimator, Lazy<ScrimController> scrimControllerLazy, IActivityTaskManager activityTaskManagerService) { IActivityTaskManager activityTaskManagerService, FeatureFlags featureFlags) { return new KeyguardViewMediator( context, userTracker, Loading Loading @@ -152,7 +154,8 @@ public class KeyguardModule { notificationShadeWindowController, activityLaunchAnimator, scrimControllerLazy, activityTaskManagerService); activityTaskManagerService, featureFlags); } /** */ Loading packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java +30 −1 Original line number Diff line number Diff line Loading @@ -73,6 +73,8 @@ import com.android.systemui.classifier.FalsingCollectorFake; import com.android.systemui.colorextraction.SysuiColorExtractor; import com.android.systemui.dreams.DreamOverlayStateController; import com.android.systemui.dump.DumpManager; import com.android.systemui.flags.FakeFeatureFlags; import com.android.systemui.flags.Flags; import com.android.systemui.navigationbar.NavigationModeController; import com.android.systemui.settings.UserTracker; import com.android.systemui.shade.NotificationShadeWindowControllerImpl; Loading Loading @@ -156,6 +158,8 @@ public class KeyguardViewMediatorTest extends SysuiTestCase { /** Most recent value passed to {@link KeyguardStateController#notifyKeyguardGoingAway}. */ private boolean mKeyguardGoingAway = false; private FakeFeatureFlags mFeatureFlags; @Before public void setUp() throws Exception { MockitoAnnotations.initMocks(this); Loading @@ -174,6 +178,8 @@ public class KeyguardViewMediatorTest extends SysuiTestCase { mColorExtractor, mDumpManager, mKeyguardStateController, mScreenOffAnimationController, mAuthController, mShadeExpansionStateManager, mShadeWindowLogger); mFeatureFlags = new FakeFeatureFlags(); DejankUtils.setImmediate(true); Loading Loading @@ -628,6 +634,28 @@ public class KeyguardViewMediatorTest extends SysuiTestCase { .setLockScreenShown(eq(true), anyBoolean()); } @Test @TestableLooper.RunWithLooper(setAsMainLooper = true) public void testNotStartingKeyguardWhenFlagIsDisabled() { mViewMediator.setShowingLocked(false); when(mKeyguardStateController.isShowing()).thenReturn(false); mFeatureFlags.set(Flags.LOCKSCREEN_WITHOUT_SECURE_LOCK_WHEN_DREAMING, false); mViewMediator.onDreamingStarted(); assertFalse(mViewMediator.isShowingAndNotOccluded()); } @Test @TestableLooper.RunWithLooper(setAsMainLooper = true) public void testStartingKeyguardWhenFlagIsEnabled() { mViewMediator.setShowingLocked(true); when(mKeyguardStateController.isShowing()).thenReturn(true); mFeatureFlags.set(Flags.LOCKSCREEN_WITHOUT_SECURE_LOCK_WHEN_DREAMING, true); mViewMediator.onDreamingStarted(); assertTrue(mViewMediator.isShowingAndNotOccluded()); } private void createAndStartViewMediator() { mViewMediator = new KeyguardViewMediator( mContext, Loading Loading @@ -659,7 +687,8 @@ public class KeyguardViewMediatorTest extends SysuiTestCase { () -> mNotificationShadeWindowController, () -> mActivityLaunchAnimator, () -> mScrimController, mActivityTaskManagerService); mActivityTaskManagerService, mFeatureFlags); mViewMediator.start(); mViewMediator.registerCentralSurfaces(mCentralSurfaces, null, null, null, null, null); Loading Loading
packages/SystemUI/src/com/android/systemui/flags/Flags.kt +5 −0 Original line number Diff line number Diff line Loading @@ -132,6 +132,11 @@ object Flags { // TODO(b/254512676): Tracking Bug @JvmField val LOCKSCREEN_CUSTOM_CLOCKS = releasedFlag(207, "lockscreen_custom_clocks") // TODO(b/275694445): Tracking Bug @JvmField val LOCKSCREEN_WITHOUT_SECURE_LOCK_WHEN_DREAMING = unreleasedFlag(208, "lockscreen_without_secure_lock_when_dreaming") /** * Whether the clock on a wide lock screen should use the new "stepping" animation for moving * the digits when the clock moves. Loading
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +14 −4 Original line number Diff line number Diff line Loading @@ -128,6 +128,8 @@ import com.android.systemui.classifier.FalsingCollector; import com.android.systemui.dagger.qualifiers.UiBackground; import com.android.systemui.dreams.DreamOverlayStateController; import com.android.systemui.dump.DumpManager; import com.android.systemui.flags.FeatureFlags; import com.android.systemui.flags.Flags; import com.android.systemui.keyguard.dagger.KeyguardModule; import com.android.systemui.navigationbar.NavigationModeController; import com.android.systemui.plugins.statusbar.StatusBarStateController; Loading Loading @@ -1185,6 +1187,8 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, private Lazy<ScrimController> mScrimControllerLazy; private IActivityTaskManager mActivityTaskManagerService; private FeatureFlags mFeatureFlags; /** * Injected constructor. See {@link KeyguardModule}. */ Loading Loading @@ -1216,7 +1220,8 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, Lazy<NotificationShadeWindowController> notificationShadeWindowControllerLazy, Lazy<ActivityLaunchAnimator> activityLaunchAnimator, Lazy<ScrimController> scrimControllerLazy, IActivityTaskManager activityTaskManagerService) { IActivityTaskManager activityTaskManagerService, FeatureFlags featureFlags) { mContext = context; mUserTracker = userTracker; mFalsingCollector = falsingCollector; Loading Loading @@ -1272,6 +1277,8 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, mDreamOpenAnimationDuration = (int) DREAMING_ANIMATION_DURATION_MS; mDreamCloseAnimationDuration = (int) LOCKSCREEN_ANIMATION_DURATION_MS; mFeatureFlags = featureFlags; } public void userActivity() { Loading Loading @@ -1685,14 +1692,17 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, } /** * A dream started. We should lock after the usual screen-off lock timeout but only * if there is a secure lock pattern. * A dream started. We should lock after the usual screen-off lock timeout regardless if * there is a secure lock pattern or not */ public void onDreamingStarted() { mUpdateMonitor.dispatchDreamingStarted(); synchronized (this) { final boolean alwaysShowKeyguard = mFeatureFlags.isEnabled(Flags.LOCKSCREEN_WITHOUT_SECURE_LOCK_WHEN_DREAMING); if (mDeviceInteractive && mLockPatternUtils.isSecure(KeyguardUpdateMonitor.getCurrentUser())) { && (alwaysShowKeyguard || mLockPatternUtils.isSecure(KeyguardUpdateMonitor.getCurrentUser()))) { doKeyguardLaterLocked(); } } Loading
packages/SystemUI/src/com/android/systemui/keyguard/dagger/KeyguardModule.java +5 −2 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.dagger.qualifiers.UiBackground; import com.android.systemui.dreams.DreamOverlayStateController; import com.android.systemui.dump.DumpManager; import com.android.systemui.flags.FeatureFlags; import com.android.systemui.keyguard.DismissCallbackRegistry; import com.android.systemui.keyguard.KeyguardUnlockAnimationController; import com.android.systemui.keyguard.KeyguardViewMediator; Loading Loading @@ -121,7 +122,8 @@ public class KeyguardModule { Lazy<NotificationShadeWindowController> notificationShadeWindowController, Lazy<ActivityLaunchAnimator> activityLaunchAnimator, Lazy<ScrimController> scrimControllerLazy, IActivityTaskManager activityTaskManagerService) { IActivityTaskManager activityTaskManagerService, FeatureFlags featureFlags) { return new KeyguardViewMediator( context, userTracker, Loading Loading @@ -152,7 +154,8 @@ public class KeyguardModule { notificationShadeWindowController, activityLaunchAnimator, scrimControllerLazy, activityTaskManagerService); activityTaskManagerService, featureFlags); } /** */ Loading
packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java +30 −1 Original line number Diff line number Diff line Loading @@ -73,6 +73,8 @@ import com.android.systemui.classifier.FalsingCollectorFake; import com.android.systemui.colorextraction.SysuiColorExtractor; import com.android.systemui.dreams.DreamOverlayStateController; import com.android.systemui.dump.DumpManager; import com.android.systemui.flags.FakeFeatureFlags; import com.android.systemui.flags.Flags; import com.android.systemui.navigationbar.NavigationModeController; import com.android.systemui.settings.UserTracker; import com.android.systemui.shade.NotificationShadeWindowControllerImpl; Loading Loading @@ -156,6 +158,8 @@ public class KeyguardViewMediatorTest extends SysuiTestCase { /** Most recent value passed to {@link KeyguardStateController#notifyKeyguardGoingAway}. */ private boolean mKeyguardGoingAway = false; private FakeFeatureFlags mFeatureFlags; @Before public void setUp() throws Exception { MockitoAnnotations.initMocks(this); Loading @@ -174,6 +178,8 @@ public class KeyguardViewMediatorTest extends SysuiTestCase { mColorExtractor, mDumpManager, mKeyguardStateController, mScreenOffAnimationController, mAuthController, mShadeExpansionStateManager, mShadeWindowLogger); mFeatureFlags = new FakeFeatureFlags(); DejankUtils.setImmediate(true); Loading Loading @@ -628,6 +634,28 @@ public class KeyguardViewMediatorTest extends SysuiTestCase { .setLockScreenShown(eq(true), anyBoolean()); } @Test @TestableLooper.RunWithLooper(setAsMainLooper = true) public void testNotStartingKeyguardWhenFlagIsDisabled() { mViewMediator.setShowingLocked(false); when(mKeyguardStateController.isShowing()).thenReturn(false); mFeatureFlags.set(Flags.LOCKSCREEN_WITHOUT_SECURE_LOCK_WHEN_DREAMING, false); mViewMediator.onDreamingStarted(); assertFalse(mViewMediator.isShowingAndNotOccluded()); } @Test @TestableLooper.RunWithLooper(setAsMainLooper = true) public void testStartingKeyguardWhenFlagIsEnabled() { mViewMediator.setShowingLocked(true); when(mKeyguardStateController.isShowing()).thenReturn(true); mFeatureFlags.set(Flags.LOCKSCREEN_WITHOUT_SECURE_LOCK_WHEN_DREAMING, true); mViewMediator.onDreamingStarted(); assertTrue(mViewMediator.isShowingAndNotOccluded()); } private void createAndStartViewMediator() { mViewMediator = new KeyguardViewMediator( mContext, Loading Loading @@ -659,7 +687,8 @@ public class KeyguardViewMediatorTest extends SysuiTestCase { () -> mNotificationShadeWindowController, () -> mActivityLaunchAnimator, () -> mScrimController, mActivityTaskManagerService); mActivityTaskManagerService, mFeatureFlags); mViewMediator.start(); mViewMediator.registerCentralSurfaces(mCentralSurfaces, null, null, null, null, null); Loading