summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Matt Pietal <mpietal@google.com> 2021-06-10 16:13:19 -0400
committer Matt Pietal <mpietal@google.com> 2021-06-11 07:58:21 -0400
commitc9b7dfea0cf44a7ad47b40a08e12a71198d3f464 (patch)
tree8a645cfd674fc654fb967df6bd914f10a74dc1c4
parent745deffa8ff5f6567280548cedbd8b66c895ced3 (diff)
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
-rw-r--r--packages/SystemUI/src/com/android/keyguard/AnimatableClockController.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java46
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java12
3 files changed, 12 insertions, 50 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/AnimatableClockController.java b/packages/SystemUI/src/com/android/keyguard/AnimatableClockController.java
index 92af58eb9af4..08076c17dc3a 100644
--- a/packages/SystemUI/src/com/android/keyguard/AnimatableClockController.java
+++ b/packages/SystemUI/src/com/android/keyguard/AnimatableClockController.java
@@ -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();
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java
index 7c2723d724ce..29bf1edfabc4 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java
@@ -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 */);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java
index 20f3fc955ba5..604033efc944 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java
@@ -254,12 +254,6 @@ public class NotificationPanelViewController extends PanelViewController {
new KeyguardUpdateMonitorCallback() {
@Override
- public void onLockScreenModeChanged(int mode) {
- mLockScreenMode = mode;
- mClockPositionAlgorithm.onLockScreenModeChanged(mode);
- }
-
- @Override
public void onBiometricAuthenticated(int userId,
BiometricSourceType biometricSourceType,
boolean isStrongBiometric) {
@@ -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,