Merge "Don't show udfps disabled after biometric auth" into sc-dev

This commit is contained in:
Beverly Tai
2021-04-28 11:40:09 +00:00
committed by Android (Google) Code Review
2 changed files with 25 additions and 28 deletions

View File

@@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2020 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<com.android.keyguard.DisabledUdfpsView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/disabled_udfps_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>

View File

@@ -83,6 +83,7 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
private boolean mQsExpanded;
private int mStatusBarState;
private boolean mIsKeyguardShowing;
private boolean mUserUnlockedWithBiometric;
private boolean mShowButton;
private boolean mShowUnlockIcon;
@@ -155,7 +156,8 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
mView.setLocation(new PointF(props[0], props[1]), props[2]);
}
mIsKeyguardShowing = mKeyguardViewController.isShowing();
updateKeyguardShowing();
mUserUnlockedWithBiometric = false;
mIsBouncerShowing = mKeyguardViewController.isBouncerShowing();
mIsDozing = mStatusBarStateController.isDozing();
mRunningFPS = mKeyguardUpdateMonitor.isFingerprintDetectionRunning();
@@ -216,7 +218,8 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
}
// these three states are mutually exclusive:
mShowButton = mUdfpsEnrolled && !mCanDismissLockScreen && !mRunningFPS && isLockScreen();
mShowButton = mUdfpsEnrolled && !mCanDismissLockScreen && !mRunningFPS
&& !mUserUnlockedWithBiometric && isLockScreen();
mShowUnlockIcon = mFaceAuthEnrolled & mCanDismissLockScreen && isLockScreen();
mShowLockIcon = !mUdfpsEnrolled && !mCanDismissLockScreen && isLockScreen()
&& mFaceAuthEnrolled;
@@ -289,6 +292,11 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
}
}
private void updateKeyguardShowing() {
mIsKeyguardShowing = mKeyguardStateController.isShowing()
&& !mKeyguardStateController.isKeyguardGoingAway();
}
@Override
public void dump(@NonNull FileDescriptor fd, @NonNull PrintWriter pw, @NonNull String[] args) {
pw.println(" mShowBouncerButton: " + mShowButton);
@@ -300,6 +308,7 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
pw.println(" mIsKeyguardShowing: " + mIsKeyguardShowing);
pw.println(" mIsDozing: " + mIsDozing);
pw.println(" mIsBouncerShowing: " + mIsBouncerShowing);
pw.println(" mUserUnlockedWithBiometric: " + mUserUnlockedWithBiometric);
pw.println(" mRunningFPS: " + mRunningFPS);
pw.println(" mCanDismissLockScreen: " + mCanDismissLockScreen);
pw.println(" mStatusBarState: " + StatusBarState.toShortString(mStatusBarState));
@@ -326,18 +335,20 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
@Override
public void onKeyguardBouncerChanged(boolean bouncer) {
mIsBouncerShowing = bouncer;
mIsKeyguardShowing = mKeyguardStateController.isShowing();
updateVisibility();
}
@Override
public void onBiometricRunningStateChanged(boolean running,
BiometricSourceType biometricSourceType) {
mUserUnlockedWithBiometric =
mKeyguardUpdateMonitor.getUserUnlockedWithBiometric(
KeyguardUpdateMonitor.getCurrentUser());
if (biometricSourceType == FINGERPRINT) {
mRunningFPS = running;
updateVisibility();
}
updateVisibility();
}
};
@@ -346,15 +357,23 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
@Override
public void onUnlockedChanged() {
mCanDismissLockScreen = mKeyguardStateController.canDismissLockScreen();
updateKeyguardShowing();
updateVisibility();
}
@Override
public void onKeyguardShowingChanged() {
mIsKeyguardShowing = mKeyguardStateController.isShowing();
updateKeyguardShowing();
mUdfpsEnrolled = mKeyguardUpdateMonitor.isUdfpsEnrolled();
mFaceAuthEnrolled = mKeyguardUpdateMonitor.isFaceEnrolled();
updateVisibility();
}
@Override
public void onKeyguardFadingAwayChanged() {
updateKeyguardShowing();
updateVisibility();
}
};
private final AccessibilityManager.TouchExplorationStateChangeListener