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