summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Tsuji <tsuji@google.com>2022-02-22 13:15:19 -0500
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-03-03 03:26:58 +0000
commitd3be2c9d4b7dfd48abb9207135845a16bd1d1361 (patch)
treea38424983812accfb0d3702806775501780e1a05
parentacda85f65bc3f3e4d64277bb6e5cd24fe079bb87 (diff)
downloadbase-d3be2c9d4b7dfd48abb9207135845a16bd1d1361.tar.gz
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 Merged-In: I00655c2e85c46bd0c52b77094757e155b1a6f9c9 Change-Id: I9261ab9f04cc06db379676dccca72e452ece98d7 (cherry picked from commit c3a2eeaed337f445424d3b086ee0d14f1d9358e1) Merged-In: I9261ab9f04cc06db379676dccca72e452ece98d7
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt10
1 files changed, 9 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt
index fabe92d2532d..94d5ee2b923c 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt
@@ -21,6 +21,7 @@ import android.animation.AnimatorListenerAdapter
import android.animation.ValueAnimator
import android.content.Context
import android.graphics.Matrix
+import android.util.Log
import android.view.RemoteAnimationTarget
import android.view.SyncRtSurfaceTransactionApplier
import android.view.View
@@ -38,6 +39,8 @@ import com.android.systemui.statusbar.policy.KeyguardStateController
import dagger.Lazy
import javax.inject.Inject
+const val TAG = "KeyguardUnlock"
+
/**
* Starting scale factor for the app/launcher surface behind the keyguard, when it's animating
* in during keyguard exit.
@@ -254,7 +257,12 @@ class KeyguardUnlockAnimationController @Inject constructor(
}
fun hideKeyguardViewAfterRemoteAnimation() {
- keyguardViewController.hide(surfaceBehindRemoteAnimationStartTime, 350)
+ if (keyguardViewController.isShowing) {
+ keyguardViewController.hide(surfaceBehindRemoteAnimationStartTime, 350)
+ } else {
+ Log.e(TAG, "#hideKeyguardViewAfterRemoteAnimation called when keyguard view is not " +
+ "showing. Ignoring...")
+ }
}
/**