Bypass fixes for clock

1. Algo bypass flag can be ignored for positioning, as it was causing
the keyguard to get stuck and show underneath the bouncer.
2. Cleanup old layout code
3. The clock would disappear after face auth on reboot, since the
bouncer is required. Check for strong auth

Fixes: 185314537
Test: manual exploration with and without bypass and face auth
Change-Id: I423fc81d3dca7aa7d8c44cd152bd29d91c479322
This commit is contained in:
Matt Pietal
2021-06-10 16:13:19 -04:00
parent 745deffa8f
commit c9b7dfea0c
3 changed files with 12 additions and 50 deletions

View File

@@ -127,8 +127,10 @@ public class AnimatableClockController extends ViewController<AnimatableClockVie
@Override
public void onBiometricAuthenticated(int userId, BiometricSourceType biometricSourceType,
boolean isStrongBiometric) {
// Strong auth will force the bouncer regardless of a successful face auth
if (biometricSourceType == BiometricSourceType.FACE
&& mBypassController.canBypass()) {
&& mBypassController.canBypass()
&& !mKeyguardUpdateMonitor.userNeedsStrongAuth()) {
mView.animateDisappear();
}
}

View File

@@ -24,7 +24,6 @@ import android.content.res.Resources;
import android.util.MathUtils;
import com.android.keyguard.KeyguardStatusView;
import com.android.keyguard.KeyguardUpdateMonitor;
import com.android.systemui.R;
import com.android.systemui.animation.Interpolators;
import com.android.systemui.statusbar.policy.KeyguardUserSwitcherListView;
@@ -153,8 +152,6 @@ public class KeyguardClockPositionAlgorithm {
*/
private int mUnlockedStackScrollerPadding;
private int mLockScreenMode;
private boolean mIsSplitShade;
/**
@@ -228,13 +225,6 @@ public class KeyguardClockPositionAlgorithm {
}
}
/**
* Update lock screen mode for testing different layouts
*/
public void onLockScreenModeChanged(int mode) {
mLockScreenMode = mode;
}
public float getMinStackScrollerPadding() {
return mBypassEnabled ? mUnlockedStackScrollerPadding
: mMinTopMargin + mKeyguardStatusHeight + mClockNotificationsMargin;
@@ -245,11 +235,7 @@ public class KeyguardClockPositionAlgorithm {
}
private int getExpandedPreferredClockY() {
if (mLockScreenMode != KeyguardUpdateMonitor.LOCK_SCREEN_MODE_NORMAL) {
return mMinTopMargin + mUserSwitchHeight;
}
return (mHasCustomClock && (!mHasVisibleNotifs || mBypassEnabled)) ? mClockPreferredY
: getExpandedClockPosition();
return mMinTopMargin + mUserSwitchHeight;
}
/**
@@ -278,29 +264,20 @@ public class KeyguardClockPositionAlgorithm {
}
private int getClockY(float panelExpansion, float darkAmount) {
// Dark: Align the bottom edge of the clock at about half of the screen:
float clockYDark = (mHasCustomClock ? mClockPreferredY : getMaxClockY())
+ burnInPreventionOffsetY();
clockYDark = MathUtils.max(0, clockYDark);
float clockYRegular = getExpandedPreferredClockY();
float clockYBouncer = -mKeyguardStatusHeight;
// Move clock up while collapsing the shade
float shadeExpansion = Interpolators.FAST_OUT_LINEAR_IN.getInterpolation(panelExpansion);
float clockY = MathUtils.lerp(clockYBouncer, clockYRegular, shadeExpansion);
clockYDark = MathUtils.lerp(clockYBouncer, clockYDark, shadeExpansion);
darkAmount = mBypassEnabled && !mHasCustomClock ? 1.0f : darkAmount;
if (mLockScreenMode != KeyguardUpdateMonitor.LOCK_SCREEN_MODE_NORMAL) {
// This will keep the clock at the top but out of the cutout area
float shift = 0;
if (clockY - mBurnInPreventionOffsetYLargeClock < mCutoutTopInset) {
shift = mCutoutTopInset - (clockY - mBurnInPreventionOffsetYLargeClock);
}
clockYDark = clockY + burnInPreventionOffsetY() + shift;
// This will keep the clock at the top but out of the cutout area
float shift = 0;
if (clockY - mBurnInPreventionOffsetYLargeClock < mCutoutTopInset) {
shift = mCutoutTopInset - (clockY - mBurnInPreventionOffsetYLargeClock);
}
float clockYDark = clockY + burnInPreventionOffsetY() + shift;
return (int) (MathUtils.lerp(clockY, clockYDark, darkAmount) + mOverStretchAmount);
}
@@ -333,19 +310,12 @@ public class KeyguardClockPositionAlgorithm {
}
private float burnInPreventionOffsetY() {
int offset = mBurnInPreventionOffsetY;
if (mLockScreenMode != KeyguardUpdateMonitor.LOCK_SCREEN_MODE_NORMAL) {
offset = mBurnInPreventionOffsetYLargeClock;
}
int offset = mBurnInPreventionOffsetYLargeClock;
return getBurnInOffset(offset * 2, false /* xAxis */) - offset;
}
private float burnInPreventionOffsetX() {
if (mLockScreenMode == KeyguardUpdateMonitor.LOCK_SCREEN_MODE_NORMAL) {
return getBurnInOffset(mBurnInPreventionOffsetX * 2, true /* xAxis */)
- mBurnInPreventionOffsetX;
}
return getBurnInOffset(mBurnInPreventionOffsetX, true /* xAxis */);
}

View File

@@ -253,12 +253,6 @@ public class NotificationPanelViewController extends PanelViewController {
mKeyguardUpdateCallback =
new KeyguardUpdateMonitorCallback() {
@Override
public void onLockScreenModeChanged(int mode) {
mLockScreenMode = mode;
mClockPositionAlgorithm.onLockScreenModeChanged(mode);
}
@Override
public void onBiometricAuthenticated(int userId,
BiometricSourceType biometricSourceType,
@@ -594,7 +588,6 @@ public class NotificationPanelViewController extends PanelViewController {
private final Executor mUiExecutor;
private final SecureSettings mSecureSettings;
private int mLockScreenMode = KeyguardUpdateMonitor.LOCK_SCREEN_MODE_NORMAL;
private KeyguardMediaController mKeyguardMediaController;
private View.AccessibilityDelegate mAccessibilityDelegate = new View.AccessibilityDelegate() {
@@ -1254,10 +1247,7 @@ public class NotificationPanelViewController extends PanelViewController {
mNotificationStackScrollLayoutController.getIntrinsicContentHeight(),
expandedFraction,
totalHeight,
mLockScreenMode == KeyguardUpdateMonitor.LOCK_SCREEN_MODE_LAYOUT_1
? mKeyguardStatusViewController.getHeight()
: (int) (mKeyguardStatusViewController.getHeight()
- mShelfHeight / 2.0f - mDarkIconSize / 2.0f),
mKeyguardStatusViewController.getHeight(),
userIconHeight,
clockPreferredY, userSwitcherPreferredY, hasCustomClock(),
hasVisibleNotifications, darkamount, mOverStretchAmount,