Loading packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +8 −1 Original line number Diff line number Diff line Loading @@ -137,6 +137,7 @@ import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.phone.DozeParameters; import com.android.systemui.statusbar.phone.KeyguardBypassController; import com.android.systemui.statusbar.phone.ScreenOffAnimationController; import com.android.systemui.statusbar.phone.ScrimController; import com.android.systemui.statusbar.policy.KeyguardStateController; import com.android.systemui.statusbar.policy.UserSwitcherController; import com.android.systemui.util.DeviceConfigProxy; Loading Loading @@ -851,6 +852,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, @Override public void onLaunchAnimationStart(boolean isExpandingFullyAbove) { mOccludeAnimationPlaying = true; mScrimControllerLazy.get().setOccludeAnimationPlaying(true); } @Override Loading @@ -861,6 +863,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, // Ensure keyguard state is set correctly if we're cancelled. mCentralSurfaces.updateIsKeyguard(); mScrimControllerLazy.get().setOccludeAnimationPlaying(false); } @Override Loading @@ -874,6 +877,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, // Hide the keyguard now that we're done launching the occluding activity over // it. mCentralSurfaces.updateIsKeyguard(); mScrimControllerLazy.get().setOccludeAnimationPlaying(false); mInteractionJankMonitor.end(CUJ_LOCKSCREEN_OCCLUSION); } Loading Loading @@ -1138,6 +1142,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, private ScreenOnCoordinator mScreenOnCoordinator; private Lazy<ActivityLaunchAnimator> mActivityLaunchAnimator; private Lazy<ScrimController> mScrimControllerLazy; /** * Injected constructor. See {@link KeyguardModule}. Loading Loading @@ -1168,7 +1173,8 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, DreamOverlayStateController dreamOverlayStateController, Lazy<ShadeController> shadeControllerLazy, Lazy<NotificationShadeWindowController> notificationShadeWindowControllerLazy, Lazy<ActivityLaunchAnimator> activityLaunchAnimator) { Lazy<ActivityLaunchAnimator> activityLaunchAnimator, Lazy<ScrimController> scrimControllerLazy) { mContext = context; mUserTracker = userTracker; mFalsingCollector = falsingCollector; Loading Loading @@ -1213,6 +1219,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, mDreamOverlayStateController = dreamOverlayStateController; mActivityLaunchAnimator = activityLaunchAnimator; mScrimControllerLazy = scrimControllerLazy; mPowerButtonY = context.getResources().getDimensionPixelSize( R.dimen.physical_power_button_center_screen_location_y); Loading packages/SystemUI/src/com/android/systemui/keyguard/dagger/KeyguardModule.java +5 −2 Original line number Diff line number Diff line Loading @@ -54,6 +54,7 @@ import com.android.systemui.statusbar.NotificationShadeWindowController; import com.android.systemui.statusbar.SysuiStatusBarStateController; import com.android.systemui.statusbar.phone.DozeParameters; import com.android.systemui.statusbar.phone.ScreenOffAnimationController; import com.android.systemui.statusbar.phone.ScrimController; import com.android.systemui.statusbar.policy.KeyguardStateController; import com.android.systemui.statusbar.policy.UserSwitcherController; import com.android.systemui.util.DeviceConfigProxy; Loading Loading @@ -113,7 +114,8 @@ public class KeyguardModule { DreamOverlayStateController dreamOverlayStateController, Lazy<ShadeController> shadeController, Lazy<NotificationShadeWindowController> notificationShadeWindowController, Lazy<ActivityLaunchAnimator> activityLaunchAnimator) { Lazy<ActivityLaunchAnimator> activityLaunchAnimator, Lazy<ScrimController> scrimControllerLazy) { return new KeyguardViewMediator( context, userTracker, Loading Loading @@ -142,7 +144,8 @@ public class KeyguardModule { dreamOverlayStateController, shadeController, notificationShadeWindowController, activityLaunchAnimator); activityLaunchAnimator, scrimControllerLazy); } /** */ Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java +19 −4 Original line number Diff line number Diff line Loading @@ -109,6 +109,12 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump public static final int OPAQUE = 2; private boolean mClipsQsScrim; /** * Whether an activity is launching over the lockscreen. During the launch animation, we want to * delay certain scrim changes until after the animation ends. */ private boolean mOccludeAnimationPlaying = false; /** * The amount of progress we are currently in if we're transitioning to the full shade. * 0.0f means we're not transitioning yet, while 1 means we're all the way in the full Loading Loading @@ -733,6 +739,11 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump return mClipsQsScrim; } public void setOccludeAnimationPlaying(boolean occludeAnimationPlaying) { mOccludeAnimationPlaying = occludeAnimationPlaying; applyAndDispatchState(); } private void setOrAdaptCurrentAnimation(@Nullable View scrim) { if (scrim == null) { return; Loading Loading @@ -772,11 +783,15 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump } if (mState == ScrimState.UNLOCKED || mState == ScrimState.DREAMING) { // Darken scrim as you pull down the shade when unlocked, unless the shade is expanding // because we're doing the screen off animation OR the shade is collapsing because // we're playing the unlock animation final boolean occluding = mOccludeAnimationPlaying || mState.mLaunchingAffordanceWithPreview; // Darken scrim as it's pulled down while unlocked. If we're unlocked but playing the // screen off/occlusion animations, ignore expansion changes while those animations // play. if (!mScreenOffAnimationController.shouldExpandNotifications() && !mAnimatingPanelExpansionOnUnlock) { && !mAnimatingPanelExpansionOnUnlock && !occluding) { float behindFraction = getInterpolatedFraction(); behindFraction = (float) Math.pow(behindFraction, 0.8f); if (mClipsQsScrim) { Loading packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java +4 −1 Original line number Diff line number Diff line Loading @@ -65,6 +65,7 @@ import com.android.systemui.statusbar.SysuiStatusBarStateController; import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.phone.DozeParameters; import com.android.systemui.statusbar.phone.ScreenOffAnimationController; import com.android.systemui.statusbar.phone.ScrimController; import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; import com.android.systemui.statusbar.policy.KeyguardStateController; import com.android.systemui.statusbar.policy.UserSwitcherController; Loading Loading @@ -112,6 +113,7 @@ public class KeyguardViewMediatorTest extends SysuiTestCase { private @Mock Lazy<NotificationShadeWindowController> mNotificationShadeWindowControllerLazy; private @Mock DreamOverlayStateController mDreamOverlayStateController; private @Mock ActivityLaunchAnimator mActivityLaunchAnimator; private @Mock ScrimController mScrimController; private DeviceConfigProxy mDeviceConfig = new DeviceConfigProxyFake(); private FakeExecutor mUiBgExecutor = new FakeExecutor(new FakeSystemClock()); Loading Loading @@ -314,7 +316,8 @@ public class KeyguardViewMediatorTest extends SysuiTestCase { mDreamOverlayStateController, () -> mShadeController, mNotificationShadeWindowControllerLazy, () -> mActivityLaunchAnimator); () -> mActivityLaunchAnimator, () -> mScrimController); mViewMediator.start(); mViewMediator.registerCentralSurfaces(mCentralSurfaces, null, null, null, null, null); Loading Loading
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +8 −1 Original line number Diff line number Diff line Loading @@ -137,6 +137,7 @@ import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.phone.DozeParameters; import com.android.systemui.statusbar.phone.KeyguardBypassController; import com.android.systemui.statusbar.phone.ScreenOffAnimationController; import com.android.systemui.statusbar.phone.ScrimController; import com.android.systemui.statusbar.policy.KeyguardStateController; import com.android.systemui.statusbar.policy.UserSwitcherController; import com.android.systemui.util.DeviceConfigProxy; Loading Loading @@ -851,6 +852,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, @Override public void onLaunchAnimationStart(boolean isExpandingFullyAbove) { mOccludeAnimationPlaying = true; mScrimControllerLazy.get().setOccludeAnimationPlaying(true); } @Override Loading @@ -861,6 +863,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, // Ensure keyguard state is set correctly if we're cancelled. mCentralSurfaces.updateIsKeyguard(); mScrimControllerLazy.get().setOccludeAnimationPlaying(false); } @Override Loading @@ -874,6 +877,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, // Hide the keyguard now that we're done launching the occluding activity over // it. mCentralSurfaces.updateIsKeyguard(); mScrimControllerLazy.get().setOccludeAnimationPlaying(false); mInteractionJankMonitor.end(CUJ_LOCKSCREEN_OCCLUSION); } Loading Loading @@ -1138,6 +1142,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, private ScreenOnCoordinator mScreenOnCoordinator; private Lazy<ActivityLaunchAnimator> mActivityLaunchAnimator; private Lazy<ScrimController> mScrimControllerLazy; /** * Injected constructor. See {@link KeyguardModule}. Loading Loading @@ -1168,7 +1173,8 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, DreamOverlayStateController dreamOverlayStateController, Lazy<ShadeController> shadeControllerLazy, Lazy<NotificationShadeWindowController> notificationShadeWindowControllerLazy, Lazy<ActivityLaunchAnimator> activityLaunchAnimator) { Lazy<ActivityLaunchAnimator> activityLaunchAnimator, Lazy<ScrimController> scrimControllerLazy) { mContext = context; mUserTracker = userTracker; mFalsingCollector = falsingCollector; Loading Loading @@ -1213,6 +1219,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, mDreamOverlayStateController = dreamOverlayStateController; mActivityLaunchAnimator = activityLaunchAnimator; mScrimControllerLazy = scrimControllerLazy; mPowerButtonY = context.getResources().getDimensionPixelSize( R.dimen.physical_power_button_center_screen_location_y); Loading
packages/SystemUI/src/com/android/systemui/keyguard/dagger/KeyguardModule.java +5 −2 Original line number Diff line number Diff line Loading @@ -54,6 +54,7 @@ import com.android.systemui.statusbar.NotificationShadeWindowController; import com.android.systemui.statusbar.SysuiStatusBarStateController; import com.android.systemui.statusbar.phone.DozeParameters; import com.android.systemui.statusbar.phone.ScreenOffAnimationController; import com.android.systemui.statusbar.phone.ScrimController; import com.android.systemui.statusbar.policy.KeyguardStateController; import com.android.systemui.statusbar.policy.UserSwitcherController; import com.android.systemui.util.DeviceConfigProxy; Loading Loading @@ -113,7 +114,8 @@ public class KeyguardModule { DreamOverlayStateController dreamOverlayStateController, Lazy<ShadeController> shadeController, Lazy<NotificationShadeWindowController> notificationShadeWindowController, Lazy<ActivityLaunchAnimator> activityLaunchAnimator) { Lazy<ActivityLaunchAnimator> activityLaunchAnimator, Lazy<ScrimController> scrimControllerLazy) { return new KeyguardViewMediator( context, userTracker, Loading Loading @@ -142,7 +144,8 @@ public class KeyguardModule { dreamOverlayStateController, shadeController, notificationShadeWindowController, activityLaunchAnimator); activityLaunchAnimator, scrimControllerLazy); } /** */ Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java +19 −4 Original line number Diff line number Diff line Loading @@ -109,6 +109,12 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump public static final int OPAQUE = 2; private boolean mClipsQsScrim; /** * Whether an activity is launching over the lockscreen. During the launch animation, we want to * delay certain scrim changes until after the animation ends. */ private boolean mOccludeAnimationPlaying = false; /** * The amount of progress we are currently in if we're transitioning to the full shade. * 0.0f means we're not transitioning yet, while 1 means we're all the way in the full Loading Loading @@ -733,6 +739,11 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump return mClipsQsScrim; } public void setOccludeAnimationPlaying(boolean occludeAnimationPlaying) { mOccludeAnimationPlaying = occludeAnimationPlaying; applyAndDispatchState(); } private void setOrAdaptCurrentAnimation(@Nullable View scrim) { if (scrim == null) { return; Loading Loading @@ -772,11 +783,15 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump } if (mState == ScrimState.UNLOCKED || mState == ScrimState.DREAMING) { // Darken scrim as you pull down the shade when unlocked, unless the shade is expanding // because we're doing the screen off animation OR the shade is collapsing because // we're playing the unlock animation final boolean occluding = mOccludeAnimationPlaying || mState.mLaunchingAffordanceWithPreview; // Darken scrim as it's pulled down while unlocked. If we're unlocked but playing the // screen off/occlusion animations, ignore expansion changes while those animations // play. if (!mScreenOffAnimationController.shouldExpandNotifications() && !mAnimatingPanelExpansionOnUnlock) { && !mAnimatingPanelExpansionOnUnlock && !occluding) { float behindFraction = getInterpolatedFraction(); behindFraction = (float) Math.pow(behindFraction, 0.8f); if (mClipsQsScrim) { Loading
packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java +4 −1 Original line number Diff line number Diff line Loading @@ -65,6 +65,7 @@ import com.android.systemui.statusbar.SysuiStatusBarStateController; import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.phone.DozeParameters; import com.android.systemui.statusbar.phone.ScreenOffAnimationController; import com.android.systemui.statusbar.phone.ScrimController; import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; import com.android.systemui.statusbar.policy.KeyguardStateController; import com.android.systemui.statusbar.policy.UserSwitcherController; Loading Loading @@ -112,6 +113,7 @@ public class KeyguardViewMediatorTest extends SysuiTestCase { private @Mock Lazy<NotificationShadeWindowController> mNotificationShadeWindowControllerLazy; private @Mock DreamOverlayStateController mDreamOverlayStateController; private @Mock ActivityLaunchAnimator mActivityLaunchAnimator; private @Mock ScrimController mScrimController; private DeviceConfigProxy mDeviceConfig = new DeviceConfigProxyFake(); private FakeExecutor mUiBgExecutor = new FakeExecutor(new FakeSystemClock()); Loading Loading @@ -314,7 +316,8 @@ public class KeyguardViewMediatorTest extends SysuiTestCase { mDreamOverlayStateController, () -> mShadeController, mNotificationShadeWindowControllerLazy, () -> mActivityLaunchAnimator); () -> mActivityLaunchAnimator, () -> mScrimController); mViewMediator.start(); mViewMediator.registerCentralSurfaces(mCentralSurfaces, null, null, null, null, null); Loading