Merge changes I447f5c9c,Id3de50c6,I13e9ef2f into sc-v2-dev

* changes:
  Don't show the keyguard status bar if we're animating the screen off.
  Adjust unlock parameters so that the lockscreen content doesn't overlap with the app/launcher.
  Don't play the screen off animation if we disabled animations system-wide.
This commit is contained in:
TreeHugger Robot
2021-10-19 22:40:28 +00:00
committed by Android (Google) Code Review
3 changed files with 18 additions and 5 deletions

View File

@@ -62,7 +62,7 @@ const val SURFACE_BEHIND_SCALE_PIVOT_Y = 0.66f
* The dismiss amount is the inverse of the notification panel expansion, which decreases as the
* lock screen is swiped away.
*/
const val DISMISS_AMOUNT_SHOW_SURFACE_THRESHOLD = 0.1f
const val DISMISS_AMOUNT_SHOW_SURFACE_THRESHOLD = 0.25f
/**
* Dismiss amount at which to complete the keyguard exit animation and hide the keyguard.
@@ -70,7 +70,7 @@ const val DISMISS_AMOUNT_SHOW_SURFACE_THRESHOLD = 0.1f
* The dismiss amount is the inverse of the notification panel expansion, which decreases as the
* lock screen is swiped away.
*/
const val DISMISS_AMOUNT_EXIT_KEYGUARD_THRESHOLD = 0.3f
const val DISMISS_AMOUNT_EXIT_KEYGUARD_THRESHOLD = 0.4f
/**
* Initiates, controls, and ends the keyguard unlock animation.

View File

@@ -4380,9 +4380,16 @@ public class NotificationPanelViewController extends PanelViewController {
}
}
} else {
mKeyguardStatusBarViewController.updateViewState(
/* alpha= */ 1f,
keyguardShowing ? View.VISIBLE : View.INVISIBLE);
final boolean animatingUnlockedShadeToKeyguard = oldState == SHADE
&& statusBarState == KEYGUARD
&& mUnlockedScreenOffAnimationController.isScreenOffAnimationPlaying();
if (!animatingUnlockedShadeToKeyguard) {
// Only make the status bar visible if we're not animating the screen off, since
// we only want to be showing the clock/notifications during the animation.
mKeyguardStatusBarViewController.updateViewState(
/* alpha= */ 1f,
keyguardShowing ? View.VISIBLE : View.INVISIBLE);
}
if (keyguardShowing && oldState != mBarState) {
if (mQs != null) {
mQs.hideImmediately();

View File

@@ -226,6 +226,12 @@ class UnlockedScreenOffAnimationController @Inject constructor(
return false
}
// If animations are disabled system-wide, don't play this one either.
if (Settings.Global.getString(
context.contentResolver, Settings.Global.ANIMATOR_DURATION_SCALE) == "0") {
return false
}
// We only play the unlocked screen off animation if we are... unlocked.
if (statusBarStateControllerImpl.state != StatusBarState.SHADE) {
return false