summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Josh Tsuji <tsuji@google.com> 2022-02-24 17:47:30 -0500
committer Josh Tsuji <tsuji@google.com> 2022-03-01 10:25:58 -0500
commit22ae995c20145b9fdd3ab2ff1da926c57d39bfef (patch)
treeee8b4ae55aa3bcd73ef46e4578e59d01b8379bd2
parentc19e7239314353a405ce07bc7abc9865cc78c316 (diff)
Don't re-hide the keyguard if it isn't showing.
This has a horrifying and unpredictable side effect of triggering post-unlock Runnables that are stored in StatusBar.java, which can result in a blank screen on unlock in certain race conditions. Test: unlock, launch an app during the unlock animation, press power, wake up at bad time Test: I wrote a custom build to force the above scenario to verify this works Fixes: 214647311 Change-Id: I00655c2e85c46bd0c52b77094757e155b1a6f9c9
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt15
1 files changed, 13 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt
index 582965a12528..35f29b94966f 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt
@@ -23,6 +23,7 @@ import android.content.Context
import android.graphics.Matrix
import android.graphics.Rect
import android.os.Handler
+import android.util.Log
import android.view.RemoteAnimationTarget
import android.view.SyncRtSurfaceTransactionApplier
import android.view.View
@@ -47,6 +48,8 @@ import dagger.Lazy
import javax.inject.Inject
import kotlin.math.min
+const val TAG = "KeyguardUnlock"
+
/**
* Starting scale factor for the app/launcher surface behind the keyguard, when it's animating
* in during keyguard exit.
@@ -584,8 +587,16 @@ class KeyguardUnlockAnimationController @Inject constructor(
* animation.
*/
fun hideKeyguardViewAfterRemoteAnimation() {
- // Hide the keyguard, with no fade out since we animated it away during the unlock.
- keyguardViewController.hide(surfaceBehindRemoteAnimationStartTime, 0 /* fadeOutDuration */)
+ if (keyguardViewController.isShowing) {
+ // Hide the keyguard, with no fade out since we animated it away during the unlock.
+ keyguardViewController.hide(
+ surfaceBehindRemoteAnimationStartTime,
+ 0 /* fadeOutDuration */
+ )
+ } else {
+ Log.e(TAG, "#hideKeyguardViewAfterRemoteAnimation called when keyguard view is not " +
+ "showing. Ignoring...")
+ }
}
private fun applyParamsToSurface(params: SyncRtSurfaceTransactionApplier.SurfaceParams) {