Merge "Always invoke scrim callback"
This commit is contained in:
committed by
Android (Google) Code Review
commit
1fa458fd7f
@@ -195,6 +195,10 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener,
|
||||
|
||||
public void transitionTo(ScrimState state, Callback callback) {
|
||||
if (state == mState) {
|
||||
// Call the callback anyway, unless it's already enqueued
|
||||
if (callback != null && mCallback != callback) {
|
||||
callback.onFinished();
|
||||
}
|
||||
return;
|
||||
} else if (DEBUG) {
|
||||
Log.d(TAG, "State changed to: " + state);
|
||||
|
||||
@@ -656,7 +656,9 @@ public class StatusBar extends SystemUI implements DemoMode,
|
||||
+ "mStatusBarKeyguardViewManager was null");
|
||||
return;
|
||||
}
|
||||
mStatusBarKeyguardViewManager.onKeyguardFadedAway();
|
||||
if (mKeyguardFadingAway) {
|
||||
mStatusBarKeyguardViewManager.onKeyguardFadedAway();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -380,8 +380,6 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
||||
mStatusBar.fadeKeyguardWhilePulsing();
|
||||
wakeAndUnlockDejank();
|
||||
} else {
|
||||
mFingerprintUnlockController.startKeyguardFadingAway();
|
||||
mStatusBar.setKeyguardFadingAway(startTime, delay, fadeoutDuration);
|
||||
boolean staying = mStatusBar.hideKeyguard();
|
||||
if (!staying) {
|
||||
mStatusBarWindowManager.setKeyguardFadingAway(true);
|
||||
|
||||
@@ -229,6 +229,15 @@ public class ScrimControllerTest extends SysuiTestCase {
|
||||
verify(mWakeLock, times(1)).release();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCallbackInvokedOnSameStateTransition() {
|
||||
mScrimController.transitionTo(ScrimState.UNLOCKED);
|
||||
mScrimController.finishAnimationsImmediately();
|
||||
ScrimController.Callback callback = mock(ScrimController.Callback.class);
|
||||
mScrimController.transitionTo(ScrimState.UNLOCKED, callback);
|
||||
verify(callback, times(1)).onFinished();
|
||||
}
|
||||
|
||||
private void assertScrimTint(ScrimView scrimView, boolean tinted) {
|
||||
final boolean viewIsTinted = scrimView.getTint() != Color.TRANSPARENT;
|
||||
final String name = scrimView == mScrimInFront ? "front" : "back";
|
||||
|
||||
Reference in New Issue
Block a user