Merge changes I0ababa6b,I1a1ad69b into tm-dev
* changes: Run cancelAction if bouncer is canceled Fix bouncer flicker on lockscreen shade transition
This commit is contained in:
committed by
Android (Google) Code Review
commit
27a45d8ec3
@@ -107,7 +107,6 @@ import android.view.WindowManager;
|
|||||||
import android.view.WindowManagerGlobal;
|
import android.view.WindowManagerGlobal;
|
||||||
import android.view.accessibility.AccessibilityManager;
|
import android.view.accessibility.AccessibilityManager;
|
||||||
import android.widget.DateTimeView;
|
import android.widget.DateTimeView;
|
||||||
import android.window.SplashScreen;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.lifecycle.Lifecycle;
|
import androidx.lifecycle.Lifecycle;
|
||||||
@@ -3508,11 +3507,6 @@ public class CentralSurfacesImpl extends CoreStartable implements
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onTrackingStopped(boolean expand) {
|
public void onTrackingStopped(boolean expand) {
|
||||||
if (mState == StatusBarState.KEYGUARD || mState == StatusBarState.SHADE_LOCKED) {
|
|
||||||
if (!expand && !mKeyguardStateController.canDismissLockScreen()) {
|
|
||||||
mStatusBarKeyguardViewManager.showBouncer(false /* scrimmed */);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Figure out way to remove these.
|
// TODO: Figure out way to remove these.
|
||||||
|
|||||||
@@ -480,12 +480,12 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
|||||||
if (mBouncer == null) {
|
if (mBouncer == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
mBouncer.hide(destroyView);
|
||||||
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.
|
||||||
cancelPostAuthActions();
|
cancelPostAuthActions();
|
||||||
}
|
}
|
||||||
mBouncer.hide(destroyView);
|
|
||||||
cancelPendingWakeupAction();
|
cancelPendingWakeupAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -312,12 +312,27 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase {
|
|||||||
mStatusBarKeyguardViewManager.dismissWithAction(
|
mStatusBarKeyguardViewManager.dismissWithAction(
|
||||||
action, cancelAction, true /* afterKeyguardGone */);
|
action, cancelAction, true /* afterKeyguardGone */);
|
||||||
|
|
||||||
|
when(mBouncer.isShowing()).thenReturn(false);
|
||||||
mStatusBarKeyguardViewManager.hideBouncer(true);
|
mStatusBarKeyguardViewManager.hideBouncer(true);
|
||||||
mStatusBarKeyguardViewManager.hide(0, 30);
|
mStatusBarKeyguardViewManager.hide(0, 30);
|
||||||
verify(action, never()).onDismiss();
|
verify(action, never()).onDismiss();
|
||||||
verify(cancelAction).run();
|
verify(cancelAction).run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testHidingBouncer_cancelsGoneRunnable() {
|
||||||
|
OnDismissAction action = mock(OnDismissAction.class);
|
||||||
|
Runnable cancelAction = mock(Runnable.class);
|
||||||
|
mStatusBarKeyguardViewManager.dismissWithAction(
|
||||||
|
action, cancelAction, true /* afterKeyguardGone */);
|
||||||
|
|
||||||
|
when(mBouncer.isShowing()).thenReturn(false);
|
||||||
|
mStatusBarKeyguardViewManager.hideBouncer(true);
|
||||||
|
|
||||||
|
verify(action, never()).onDismiss();
|
||||||
|
verify(cancelAction).run();
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testHiding_doesntCancelWhenShowing() {
|
public void testHiding_doesntCancelWhenShowing() {
|
||||||
OnDismissAction action = mock(OnDismissAction.class);
|
OnDismissAction action = mock(OnDismissAction.class);
|
||||||
|
|||||||
Reference in New Issue
Block a user