Always invoke scrim callback
Callback needs to be invoked if we're trying to switch to the same state, otherwise the window will never know that we're done fading the keyguard. Change-Id: I6779ecf18fbb23f621731d851ab343b82c3529e3 Fixes: 70481733 Fixes: 70392591 Test: Unlock by tapping on notification Test: Unlock with pin, fingerprint Test: Unlock with fingerprint when pulsing Test: Unlock by tapping on notification when pulsing Test: Open Settings from QS when Maps is SHOW_WHEN_LOCKED Test: runtest -x packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java
This commit is contained in:
@@ -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