Merge "[Bouncer] Flag off bouncer interactor." into tm-qpr-dev am: 22ae4477ed
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20131744 Change-Id: I7d224ed62fe3ac9c0bb14c4ea131d00869afa8e9 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -405,8 +405,9 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
|||||||
} else if (mNotificationPanelViewController.isUnlockHintRunning()) {
|
} else if (mNotificationPanelViewController.isUnlockHintRunning()) {
|
||||||
if (mBouncer != null) {
|
if (mBouncer != null) {
|
||||||
mBouncer.setExpansion(KeyguardBouncer.EXPANSION_HIDDEN);
|
mBouncer.setExpansion(KeyguardBouncer.EXPANSION_HIDDEN);
|
||||||
}
|
} else {
|
||||||
mBouncerInteractor.setExpansion(KeyguardBouncer.EXPANSION_HIDDEN);
|
mBouncerInteractor.setExpansion(KeyguardBouncer.EXPANSION_HIDDEN);
|
||||||
|
}
|
||||||
} else if (mStatusBarStateController.getState() == StatusBarState.SHADE_LOCKED) {
|
} else if (mStatusBarStateController.getState() == StatusBarState.SHADE_LOCKED) {
|
||||||
// Don't expand to the bouncer. Instead transition back to the lock screen (see
|
// Don't expand to the bouncer. Instead transition back to the lock screen (see
|
||||||
// CentralSurfaces#showBouncerOrLockScreenIfKeyguard)
|
// CentralSurfaces#showBouncerOrLockScreenIfKeyguard)
|
||||||
@@ -414,8 +415,9 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
|||||||
} else if (bouncerNeedsScrimming()) {
|
} else if (bouncerNeedsScrimming()) {
|
||||||
if (mBouncer != null) {
|
if (mBouncer != null) {
|
||||||
mBouncer.setExpansion(KeyguardBouncer.EXPANSION_VISIBLE);
|
mBouncer.setExpansion(KeyguardBouncer.EXPANSION_VISIBLE);
|
||||||
}
|
} else {
|
||||||
mBouncerInteractor.setExpansion(KeyguardBouncer.EXPANSION_VISIBLE);
|
mBouncerInteractor.setExpansion(KeyguardBouncer.EXPANSION_VISIBLE);
|
||||||
|
}
|
||||||
} else if (mShowing && !hideBouncerOverDream) {
|
} else if (mShowing && !hideBouncerOverDream) {
|
||||||
if (!isWakeAndUnlocking()
|
if (!isWakeAndUnlocking()
|
||||||
&& !(mBiometricUnlockController.getMode() == MODE_DISMISS_BOUNCER)
|
&& !(mBiometricUnlockController.getMode() == MODE_DISMISS_BOUNCER)
|
||||||
@@ -423,25 +425,28 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
|||||||
&& !isUnlockCollapsing()) {
|
&& !isUnlockCollapsing()) {
|
||||||
if (mBouncer != null) {
|
if (mBouncer != null) {
|
||||||
mBouncer.setExpansion(fraction);
|
mBouncer.setExpansion(fraction);
|
||||||
}
|
} else {
|
||||||
mBouncerInteractor.setExpansion(fraction);
|
mBouncerInteractor.setExpansion(fraction);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (fraction != KeyguardBouncer.EXPANSION_HIDDEN && tracking
|
if (fraction != KeyguardBouncer.EXPANSION_HIDDEN && tracking
|
||||||
&& !mKeyguardStateController.canDismissLockScreen()
|
&& !mKeyguardStateController.canDismissLockScreen()
|
||||||
&& !bouncerIsShowing()
|
&& !bouncerIsShowing()
|
||||||
&& !bouncerIsAnimatingAway()) {
|
&& !bouncerIsAnimatingAway()) {
|
||||||
if (mBouncer != null) {
|
if (mBouncer != null) {
|
||||||
mBouncer.show(false /* resetSecuritySelection */, false /* scrimmed */);
|
mBouncer.show(false /* resetSecuritySelection */, false /* scrimmed */);
|
||||||
}
|
} else {
|
||||||
mBouncerInteractor.show(/* isScrimmed= */false);
|
mBouncerInteractor.show(/* isScrimmed= */false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else if (!mShowing && isBouncerInTransit()) {
|
} else if (!mShowing && isBouncerInTransit()) {
|
||||||
// Keyguard is not visible anymore, but expansion animation was still running.
|
// Keyguard is not visible anymore, but expansion animation was still running.
|
||||||
// We need to hide the bouncer, otherwise it will be stuck in transit.
|
// We need to hide the bouncer, otherwise it will be stuck in transit.
|
||||||
if (mBouncer != null) {
|
if (mBouncer != null) {
|
||||||
mBouncer.setExpansion(KeyguardBouncer.EXPANSION_HIDDEN);
|
mBouncer.setExpansion(KeyguardBouncer.EXPANSION_HIDDEN);
|
||||||
}
|
} else {
|
||||||
mBouncerInteractor.setExpansion(KeyguardBouncer.EXPANSION_HIDDEN);
|
mBouncerInteractor.setExpansion(KeyguardBouncer.EXPANSION_HIDDEN);
|
||||||
|
}
|
||||||
} else if (mPulsing && fraction == KeyguardBouncer.EXPANSION_VISIBLE) {
|
} else if (mPulsing && fraction == KeyguardBouncer.EXPANSION_VISIBLE) {
|
||||||
// Panel expanded while pulsing but didn't translate the bouncer (because we are
|
// Panel expanded while pulsing but didn't translate the bouncer (because we are
|
||||||
// unlocked.) Let's simply wake-up to dismiss the lock screen.
|
// unlocked.) Let's simply wake-up to dismiss the lock screen.
|
||||||
@@ -487,8 +492,9 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
|||||||
mCentralSurfaces.hideKeyguard();
|
mCentralSurfaces.hideKeyguard();
|
||||||
if (mBouncer != null) {
|
if (mBouncer != null) {
|
||||||
mBouncer.show(true /* resetSecuritySelection */);
|
mBouncer.show(true /* resetSecuritySelection */);
|
||||||
}
|
} else {
|
||||||
mBouncerInteractor.show(true);
|
mBouncerInteractor.show(true);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
mCentralSurfaces.showKeyguard();
|
mCentralSurfaces.showKeyguard();
|
||||||
if (hideBouncerWhenShowing) {
|
if (hideBouncerWhenShowing) {
|
||||||
@@ -529,8 +535,9 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
|||||||
void hideBouncer(boolean destroyView) {
|
void hideBouncer(boolean destroyView) {
|
||||||
if (mBouncer != null) {
|
if (mBouncer != null) {
|
||||||
mBouncer.hide(destroyView);
|
mBouncer.hide(destroyView);
|
||||||
}
|
} else {
|
||||||
mBouncerInteractor.hide();
|
mBouncerInteractor.hide();
|
||||||
|
}
|
||||||
if (mShowing) {
|
if (mShowing) {
|
||||||
// If we were showing the bouncer and then aborting, we need to also clear out any
|
// If we were showing the bouncer and then aborting, we need to also clear out any
|
||||||
// potential actions unless we actually unlocked.
|
// potential actions unless we actually unlocked.
|
||||||
@@ -551,9 +558,10 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
|||||||
if (mShowing && !isBouncerShowing()) {
|
if (mShowing && !isBouncerShowing()) {
|
||||||
if (mBouncer != null) {
|
if (mBouncer != null) {
|
||||||
mBouncer.show(false /* resetSecuritySelection */, scrimmed);
|
mBouncer.show(false /* resetSecuritySelection */, scrimmed);
|
||||||
}
|
} else {
|
||||||
mBouncerInteractor.show(scrimmed);
|
mBouncerInteractor.show(scrimmed);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
updateStates();
|
updateStates();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -588,9 +596,10 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
|||||||
if (mBouncer != null) {
|
if (mBouncer != null) {
|
||||||
mBouncer.setDismissAction(mAfterKeyguardGoneAction,
|
mBouncer.setDismissAction(mAfterKeyguardGoneAction,
|
||||||
mKeyguardGoneCancelAction);
|
mKeyguardGoneCancelAction);
|
||||||
}
|
} else {
|
||||||
mBouncerInteractor.setDismissAction(mAfterKeyguardGoneAction,
|
mBouncerInteractor.setDismissAction(mAfterKeyguardGoneAction,
|
||||||
mKeyguardGoneCancelAction);
|
mKeyguardGoneCancelAction);
|
||||||
|
}
|
||||||
mAfterKeyguardGoneAction = null;
|
mAfterKeyguardGoneAction = null;
|
||||||
mKeyguardGoneCancelAction = null;
|
mKeyguardGoneCancelAction = null;
|
||||||
}
|
}
|
||||||
@@ -603,17 +612,21 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
|||||||
if (afterKeyguardGone) {
|
if (afterKeyguardGone) {
|
||||||
// we'll handle the dismiss action after keyguard is gone, so just show the
|
// we'll handle the dismiss action after keyguard is gone, so just show the
|
||||||
// bouncer
|
// bouncer
|
||||||
|
if (mBouncer != null) {
|
||||||
|
mBouncer.show(false /* resetSecuritySelection */);
|
||||||
|
} else {
|
||||||
mBouncerInteractor.show(/* isScrimmed= */true);
|
mBouncerInteractor.show(/* isScrimmed= */true);
|
||||||
if (mBouncer != null) mBouncer.show(false /* resetSecuritySelection */);
|
}
|
||||||
} else {
|
} else {
|
||||||
// after authentication success, run dismiss action with the option to defer
|
// after authentication success, run dismiss action with the option to defer
|
||||||
// hiding the keyguard based on the return value of the OnDismissAction
|
// hiding the keyguard based on the return value of the OnDismissAction
|
||||||
mBouncerInteractor.setDismissAction(
|
|
||||||
mAfterKeyguardGoneAction, mKeyguardGoneCancelAction);
|
|
||||||
mBouncerInteractor.show(/* isScrimmed= */true);
|
|
||||||
if (mBouncer != null) {
|
if (mBouncer != null) {
|
||||||
mBouncer.showWithDismissAction(mAfterKeyguardGoneAction,
|
mBouncer.showWithDismissAction(mAfterKeyguardGoneAction,
|
||||||
mKeyguardGoneCancelAction);
|
mKeyguardGoneCancelAction);
|
||||||
|
} else {
|
||||||
|
mBouncerInteractor.setDismissAction(
|
||||||
|
mAfterKeyguardGoneAction, mKeyguardGoneCancelAction);
|
||||||
|
mBouncerInteractor.show(/* isScrimmed= */true);
|
||||||
}
|
}
|
||||||
// bouncer will handle the dismiss action, so we no longer need to track it here
|
// bouncer will handle the dismiss action, so we no longer need to track it here
|
||||||
mAfterKeyguardGoneAction = null;
|
mAfterKeyguardGoneAction = null;
|
||||||
@@ -717,9 +730,10 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
|||||||
public void onFinishedGoingToSleep() {
|
public void onFinishedGoingToSleep() {
|
||||||
if (mBouncer != null) {
|
if (mBouncer != null) {
|
||||||
mBouncer.onScreenTurnedOff();
|
mBouncer.onScreenTurnedOff();
|
||||||
}
|
} else {
|
||||||
mBouncerInteractor.onScreenTurnedOff();
|
mBouncerInteractor.onScreenTurnedOff();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRemoteInputActive(boolean active) {
|
public void onRemoteInputActive(boolean active) {
|
||||||
@@ -830,8 +844,9 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
|||||||
if (bouncerIsShowing()) {
|
if (bouncerIsShowing()) {
|
||||||
if (mBouncer != null) {
|
if (mBouncer != null) {
|
||||||
mBouncer.startPreHideAnimation(finishRunnable);
|
mBouncer.startPreHideAnimation(finishRunnable);
|
||||||
}
|
} else {
|
||||||
mBouncerInteractor.startDisappearAnimation(finishRunnable);
|
mBouncerInteractor.startDisappearAnimation(finishRunnable);
|
||||||
|
}
|
||||||
mCentralSurfaces.onBouncerPreHideAnimation();
|
mCentralSurfaces.onBouncerPreHideAnimation();
|
||||||
|
|
||||||
// We update the state (which will show the keyguard) only if an animation will run on
|
// We update the state (which will show the keyguard) only if an animation will run on
|
||||||
@@ -1102,15 +1117,17 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
|||||||
if (bouncerDismissible || !showing || remoteInputActive) {
|
if (bouncerDismissible || !showing || remoteInputActive) {
|
||||||
if (mBouncer != null) {
|
if (mBouncer != null) {
|
||||||
mBouncer.setBackButtonEnabled(true);
|
mBouncer.setBackButtonEnabled(true);
|
||||||
}
|
} else {
|
||||||
mBouncerInteractor.setBackButtonEnabled(true);
|
mBouncerInteractor.setBackButtonEnabled(true);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (mBouncer != null) {
|
if (mBouncer != null) {
|
||||||
mBouncer.setBackButtonEnabled(false);
|
mBouncer.setBackButtonEnabled(false);
|
||||||
}
|
} else {
|
||||||
mBouncerInteractor.setBackButtonEnabled(false);
|
mBouncerInteractor.setBackButtonEnabled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
boolean navBarVisible = isNavBarVisible();
|
boolean navBarVisible = isNavBarVisible();
|
||||||
boolean lastNavBarVisible = getLastNavBarVisible();
|
boolean lastNavBarVisible = getLastNavBarVisible();
|
||||||
@@ -1274,8 +1291,9 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
|||||||
public void notifyKeyguardAuthenticated(boolean strongAuth) {
|
public void notifyKeyguardAuthenticated(boolean strongAuth) {
|
||||||
if (mBouncer != null) {
|
if (mBouncer != null) {
|
||||||
mBouncer.notifyKeyguardAuthenticated(strongAuth);
|
mBouncer.notifyKeyguardAuthenticated(strongAuth);
|
||||||
}
|
} else {
|
||||||
mBouncerInteractor.notifyKeyguardAuthenticated(strongAuth);
|
mBouncerInteractor.notifyKeyguardAuthenticated(strongAuth);
|
||||||
|
}
|
||||||
|
|
||||||
if (mAlternateAuthInterceptor != null && isShowingAlternateAuthOrAnimating()) {
|
if (mAlternateAuthInterceptor != null && isShowingAlternateAuthOrAnimating()) {
|
||||||
resetAlternateAuth(false);
|
resetAlternateAuth(false);
|
||||||
@@ -1292,10 +1310,11 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
|||||||
} else {
|
} else {
|
||||||
if (mBouncer != null) {
|
if (mBouncer != null) {
|
||||||
mBouncer.showMessage(message, colorState);
|
mBouncer.showMessage(message, colorState);
|
||||||
}
|
} else {
|
||||||
mBouncerInteractor.showMessage(message, colorState);
|
mBouncerInteractor.showMessage(message, colorState);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ViewRootImpl getViewRootImpl() {
|
public ViewRootImpl getViewRootImpl() {
|
||||||
@@ -1340,9 +1359,10 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
|||||||
public void updateResources() {
|
public void updateResources() {
|
||||||
if (mBouncer != null) {
|
if (mBouncer != null) {
|
||||||
mBouncer.updateResources();
|
mBouncer.updateResources();
|
||||||
}
|
} else {
|
||||||
mBouncerInteractor.updateResources();
|
mBouncerInteractor.updateResources();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void dump(PrintWriter pw) {
|
public void dump(PrintWriter pw) {
|
||||||
pw.println("StatusBarKeyguardViewManager:");
|
pw.println("StatusBarKeyguardViewManager:");
|
||||||
@@ -1426,10 +1446,10 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
|||||||
public void updateKeyguardPosition(float x) {
|
public void updateKeyguardPosition(float x) {
|
||||||
if (mBouncer != null) {
|
if (mBouncer != null) {
|
||||||
mBouncer.updateKeyguardPosition(x);
|
mBouncer.updateKeyguardPosition(x);
|
||||||
}
|
} else {
|
||||||
|
|
||||||
mBouncerInteractor.setKeyguardPosition(x);
|
mBouncerInteractor.setKeyguardPosition(x);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static class DismissWithActionRequest {
|
private static class DismissWithActionRequest {
|
||||||
final OnDismissAction dismissAction;
|
final OnDismissAction dismissAction;
|
||||||
@@ -1470,10 +1490,10 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
|||||||
public boolean isBouncerInTransit() {
|
public boolean isBouncerInTransit() {
|
||||||
if (mBouncer != null) {
|
if (mBouncer != null) {
|
||||||
return mBouncer.inTransit();
|
return mBouncer.inTransit();
|
||||||
}
|
} else {
|
||||||
|
|
||||||
return mBouncerInteractor.isInTransit();
|
return mBouncerInteractor.isInTransit();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns if bouncer is showing
|
* Returns if bouncer is showing
|
||||||
@@ -1481,10 +1501,10 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
|||||||
public boolean bouncerIsShowing() {
|
public boolean bouncerIsShowing() {
|
||||||
if (mBouncer != null) {
|
if (mBouncer != null) {
|
||||||
return mBouncer.isShowing();
|
return mBouncer.isShowing();
|
||||||
}
|
} else {
|
||||||
|
|
||||||
return mBouncerInteractor.isFullyShowing();
|
return mBouncerInteractor.isFullyShowing();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns if bouncer is scrimmed
|
* Returns if bouncer is scrimmed
|
||||||
@@ -1492,10 +1512,10 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
|||||||
public boolean bouncerIsScrimmed() {
|
public boolean bouncerIsScrimmed() {
|
||||||
if (mBouncer != null) {
|
if (mBouncer != null) {
|
||||||
return mBouncer.isScrimmed();
|
return mBouncer.isScrimmed();
|
||||||
}
|
} else {
|
||||||
|
|
||||||
return mBouncerInteractor.isScrimmed();
|
return mBouncerInteractor.isScrimmed();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns if bouncer is animating away
|
* Returns if bouncer is animating away
|
||||||
@@ -1503,9 +1523,10 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
|||||||
public boolean bouncerIsAnimatingAway() {
|
public boolean bouncerIsAnimatingAway() {
|
||||||
if (mBouncer != null) {
|
if (mBouncer != null) {
|
||||||
return mBouncer.isAnimatingAway();
|
return mBouncer.isAnimatingAway();
|
||||||
|
} else {
|
||||||
|
return mBouncerInteractor.isAnimatingAway();
|
||||||
}
|
}
|
||||||
|
|
||||||
return mBouncerInteractor.isAnimatingAway();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1514,10 +1535,10 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
|||||||
public boolean bouncerWillDismissWithAction() {
|
public boolean bouncerWillDismissWithAction() {
|
||||||
if (mBouncer != null) {
|
if (mBouncer != null) {
|
||||||
return mBouncer.willDismissWithAction();
|
return mBouncer.willDismissWithAction();
|
||||||
}
|
} else {
|
||||||
|
|
||||||
return mBouncerInteractor.willDismissWithAction();
|
return mBouncerInteractor.willDismissWithAction();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns if bouncer needs fullscreen bouncer. i.e. sim pin security method
|
* Returns if bouncer needs fullscreen bouncer. i.e. sim pin security method
|
||||||
|
|||||||
@@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
package com.android.systemui.statusbar.phone;
|
package com.android.systemui.statusbar.phone;
|
||||||
|
|
||||||
|
import static com.android.systemui.flags.Flags.MODERN_BOUNCER;
|
||||||
|
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
import static org.mockito.ArgumentMatchers.any;
|
import static org.mockito.ArgumentMatchers.any;
|
||||||
import static org.mockito.ArgumentMatchers.anyBoolean;
|
import static org.mockito.ArgumentMatchers.anyBoolean;
|
||||||
@@ -525,4 +527,11 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase {
|
|||||||
mBouncerExpansionCallback.onVisibilityChanged(false);
|
mBouncerExpansionCallback.onVisibilityChanged(false);
|
||||||
verify(mCentralSurfaces).setBouncerShowingOverDream(false);
|
verify(mCentralSurfaces).setBouncerShowingOverDream(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void flag_off_DoesNotCallBouncerInteractor() {
|
||||||
|
when(mFeatureFlags.isEnabled(MODERN_BOUNCER)).thenReturn(false);
|
||||||
|
mStatusBarKeyguardViewManager.hideBouncer(false);
|
||||||
|
verify(mBouncerInteractor, never()).hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user