Merge "Update unpaused udfps alpha when showing udfps bouncer" into sc-dev
This commit is contained in:
@@ -155,6 +155,13 @@ public class UdfpsKeyguardView extends UdfpsAnimationView {
|
|||||||
updateAlpha();
|
updateAlpha();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return alpha between 0 and 255
|
||||||
|
*/
|
||||||
|
int getUnpausedAlpha() {
|
||||||
|
return mAlpha;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int updateAlpha() {
|
protected int updateAlpha() {
|
||||||
int alpha = super.updateAlpha();
|
int alpha = super.updateAlpha();
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ public class UdfpsKeyguardViewController extends UdfpsAnimationViewController<Ud
|
|||||||
pw.println("mIsBouncerVisible=" + mIsBouncerVisible);
|
pw.println("mIsBouncerVisible=" + mIsBouncerVisible);
|
||||||
pw.println("mInputBouncerHiddenAmount=" + mInputBouncerHiddenAmount);
|
pw.println("mInputBouncerHiddenAmount=" + mInputBouncerHiddenAmount);
|
||||||
pw.println("mStatusBarExpansion=" + mStatusBarExpansion);
|
pw.println("mStatusBarExpansion=" + mStatusBarExpansion);
|
||||||
pw.println("mAlpha=" + mView.getAlpha());
|
pw.println("unpausedAlpha=" + mView.getUnpausedAlpha());
|
||||||
pw.println("mUdfpsRequested=" + mUdfpsRequested);
|
pw.println("mUdfpsRequested=" + mUdfpsRequested);
|
||||||
pw.println("mView.mUdfpsRequested=" + mView.mUdfpsRequested);
|
pw.println("mView.mUdfpsRequested=" + mView.mUdfpsRequested);
|
||||||
pw.println("mLaunchTransitionFadingAway=" + mLaunchTransitionFadingAway);
|
pw.println("mLaunchTransitionFadingAway=" + mLaunchTransitionFadingAway);
|
||||||
@@ -168,10 +168,10 @@ public class UdfpsKeyguardViewController extends UdfpsAnimationViewController<Ud
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean udfpsAffordanceWasNotShowing = shouldPauseAuth();
|
||||||
mShowingUdfpsBouncer = show;
|
mShowingUdfpsBouncer = show;
|
||||||
updatePauseAuth();
|
|
||||||
if (mShowingUdfpsBouncer) {
|
if (mShowingUdfpsBouncer) {
|
||||||
if (mStatusBarState == StatusBarState.SHADE_LOCKED) {
|
if (udfpsAffordanceWasNotShowing) {
|
||||||
mView.animateInUdfpsBouncer(null);
|
mView.animateInUdfpsBouncer(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -184,6 +184,8 @@ public class UdfpsKeyguardViewController extends UdfpsAnimationViewController<Ud
|
|||||||
} else {
|
} else {
|
||||||
mKeyguardUpdateMonitor.requestFaceAuthOnOccludingApp(false);
|
mKeyguardUpdateMonitor.requestFaceAuthOnOccludingApp(false);
|
||||||
}
|
}
|
||||||
|
updateAlpha();
|
||||||
|
updatePauseAuth();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -308,6 +310,7 @@ public class UdfpsKeyguardViewController extends UdfpsAnimationViewController<Ud
|
|||||||
public void requestUdfps(boolean request, int color) {
|
public void requestUdfps(boolean request, int color) {
|
||||||
mUdfpsRequested = request;
|
mUdfpsRequested = request;
|
||||||
mView.requestUdfps(request, color);
|
mView.requestUdfps(request, color);
|
||||||
|
updateAlpha();
|
||||||
updatePauseAuth();
|
updatePauseAuth();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -313,6 +313,25 @@ public class UdfpsKeyguardViewControllerTest extends SysuiTestCase {
|
|||||||
verify(mView).setUnpausedAlpha(0);
|
verify(mView).setUnpausedAlpha(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testShowUdfpsBouncer() {
|
||||||
|
// GIVEN view is attached and status bar expansion is 0
|
||||||
|
mController.onViewAttached();
|
||||||
|
captureExpansionListeners();
|
||||||
|
captureKeyguardStateControllerCallback();
|
||||||
|
captureAltAuthInterceptor();
|
||||||
|
updateStatusBarExpansion(0, true);
|
||||||
|
reset(mView);
|
||||||
|
when(mView.getContext()).thenReturn(mResourceContext);
|
||||||
|
when(mResourceContext.getString(anyInt())).thenReturn("test string");
|
||||||
|
|
||||||
|
// WHEN status bar expansion is 0 but udfps bouncer is requested
|
||||||
|
mAltAuthInterceptor.showAlternateAuthBouncer();
|
||||||
|
|
||||||
|
// THEN alpha is 0
|
||||||
|
verify(mView).setUnpausedAlpha(255);
|
||||||
|
}
|
||||||
|
|
||||||
private void sendStatusBarStateChanged(int statusBarState) {
|
private void sendStatusBarStateChanged(int statusBarState) {
|
||||||
mStatusBarStateListener.onStateChanged(statusBarState);
|
mStatusBarStateListener.onStateChanged(statusBarState);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user