diff options
| author | 2023-03-22 15:00:43 +0000 | |
|---|---|---|
| committer | 2023-03-22 15:00:43 +0000 | |
| commit | 0dddb2d92d19f24208c137d1dc3bd7ecbbb06e76 (patch) | |
| tree | d8865b31ccc574f3703a9474de723b7437b785c1 | |
| parent | 6603db5b0083f75ef80334299c4ab178b60214cb (diff) | |
| parent | a72c7d90a856af311da2b0c71eab1506d2968dd9 (diff) | |
Merge "Catch unusual DeadObjectExceptions." into udc-dev
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt | 43 |
1 files changed, 34 insertions, 9 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt index 3e52ff2c2da0..9ab2e9922531 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt @@ -22,6 +22,7 @@ import android.animation.ValueAnimator import android.content.Context import android.graphics.Matrix import android.graphics.Rect +import android.os.DeadObjectException import android.os.Handler import android.os.PowerManager import android.os.RemoteException @@ -524,10 +525,22 @@ class KeyguardUnlockAnimationController @Inject constructor( surfaceBehindAlpha = 1f setSurfaceBehindAppearAmount(1f) - launcherUnlockController?.playUnlockAnimation( - true, - UNLOCK_ANIMATION_DURATION_MS + CANNED_UNLOCK_START_DELAY, - 0 /* startDelay */) + try { + launcherUnlockController?.playUnlockAnimation( + true, + UNLOCK_ANIMATION_DURATION_MS + CANNED_UNLOCK_START_DELAY, + 0 /* startDelay */) + } catch (e: DeadObjectException) { + // Hello! If you are here investigating a bug where Launcher is blank (no icons) + // then the below assumption about Launcher's destruction was incorrect. This + // would mean prepareToUnlock was called (blanking Launcher in preparation for + // the beginning of the unlock animation), but then somehow we were unable to + // call playUnlockAnimation to animate the icons back in. + Log.e(TAG, "launcherUnlockAnimationController was dead, but non-null. " + + "Catching exception as this should mean Launcher is in the process " + + "of being destroyed, but the IPC to System UI telling us hasn't " + + "arrived yet.") + } launcherPreparedForUnlock = false } else { @@ -604,11 +617,23 @@ class KeyguardUnlockAnimationController @Inject constructor( private fun unlockToLauncherWithInWindowAnimations() { setSurfaceBehindAppearAmount(1f) - // Begin the animation, waiting for the shade to animate out. - launcherUnlockController?.playUnlockAnimation( - true /* unlocked */, - LAUNCHER_ICONS_ANIMATION_DURATION_MS /* duration */, - CANNED_UNLOCK_START_DELAY /* startDelay */) + try { + // Begin the animation, waiting for the shade to animate out. + launcherUnlockController?.playUnlockAnimation( + true /* unlocked */, + LAUNCHER_ICONS_ANIMATION_DURATION_MS /* duration */, + CANNED_UNLOCK_START_DELAY /* startDelay */) + } catch (e: DeadObjectException) { + // Hello! If you are here investigating a bug where Launcher is blank (no icons) + // then the below assumption about Launcher's destruction was incorrect. This + // would mean prepareToUnlock was called (blanking Launcher in preparation for + // the beginning of the unlock animation), but then somehow we were unable to + // call playUnlockAnimation to animate the icons back in. + Log.e(TAG, "launcherUnlockAnimationController was dead, but non-null. " + + "Catching exception as this should mean Launcher is in the process " + + "of being destroyed, but the IPC to System UI telling us hasn't " + + "arrived yet.") + } launcherPreparedForUnlock = false |