Merge "Fix UDFPS not working when a HUN is showing" into sc-v2-dev am: cb4a25f6df am: 69335a5067

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16251201

Change-Id: Ic3b8aff764e92ec5a48cd53ab1106b6754ac6625
This commit is contained in:
Ilya Matyukhin
2021-11-15 21:54:47 +00:00
committed by Automerger Merge Worker
3 changed files with 9 additions and 7 deletions

View File

@@ -111,7 +111,7 @@ abstract class UdfpsAnimationView extends FrameLayout {
return (int) ((1 - percent) * 255);
}
public void onExpansionChanged(float expansion, boolean expanded) {
public void onExpansionChanged(float expansion) {
mAlpha = expansionToAlpha(expansion);
updateAlpha();
}

View File

@@ -46,7 +46,7 @@ abstract class UdfpsAnimationViewController<T extends UdfpsAnimationView>
@NonNull final PanelExpansionStateManager mPanelExpansionStateManager;
@NonNull final DumpManager mDumpManger;
boolean mNotificationShadeExpanded;
boolean mNotificationShadeVisible;
protected UdfpsAnimationViewController(
T view,
@@ -85,7 +85,7 @@ abstract class UdfpsAnimationViewController<T extends UdfpsAnimationView>
@Override
public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
pw.println("mNotificationShadeExpanded=" + mNotificationShadeExpanded);
pw.println("mNotificationShadeVisible=" + mNotificationShadeVisible);
pw.println("shouldPauseAuth()=" + shouldPauseAuth());
pw.println("isPauseAuth=" + mView.isPauseAuth());
}
@@ -95,7 +95,7 @@ abstract class UdfpsAnimationViewController<T extends UdfpsAnimationView>
* authentication.
*/
boolean shouldPauseAuth() {
return mNotificationShadeExpanded;
return mNotificationShadeVisible;
}
/**
@@ -182,8 +182,10 @@ abstract class UdfpsAnimationViewController<T extends UdfpsAnimationView>
@Override
public void onPanelExpansionChanged(
float fraction, boolean expanded, boolean tracking) {
mNotificationShadeExpanded = expanded;
mView.onExpansionChanged(fraction, expanded);
// Notification shade can be expanded but not visible (fraction: 0.0), for example
// when a heads-up notification (HUN) is showing.
mNotificationShadeVisible = expanded && fraction > 0f;
mView.onExpansionChanged(fraction);
updatePauseAuth();
}
};

View File

@@ -211,7 +211,7 @@ public class UdfpsKeyguardViewController extends UdfpsAnimationViewController<Ud
return false;
}
if (mUdfpsRequested && !mNotificationShadeExpanded
if (mUdfpsRequested && !mNotificationShadeVisible
&& (!mIsBouncerVisible
|| mInputBouncerHiddenAmount != KeyguardBouncer.EXPANSION_VISIBLE)) {
return false;