Merge "Catch unusual DeadObjectExceptions." into udc-dev
This commit is contained in:
@@ -22,6 +22,7 @@ import android.animation.ValueAnimator
|
|||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.Matrix
|
import android.graphics.Matrix
|
||||||
import android.graphics.Rect
|
import android.graphics.Rect
|
||||||
|
import android.os.DeadObjectException
|
||||||
import android.os.Handler
|
import android.os.Handler
|
||||||
import android.os.PowerManager
|
import android.os.PowerManager
|
||||||
import android.os.RemoteException
|
import android.os.RemoteException
|
||||||
@@ -524,10 +525,22 @@ class KeyguardUnlockAnimationController @Inject constructor(
|
|||||||
surfaceBehindAlpha = 1f
|
surfaceBehindAlpha = 1f
|
||||||
setSurfaceBehindAppearAmount(1f)
|
setSurfaceBehindAppearAmount(1f)
|
||||||
|
|
||||||
|
try {
|
||||||
launcherUnlockController?.playUnlockAnimation(
|
launcherUnlockController?.playUnlockAnimation(
|
||||||
true,
|
true,
|
||||||
UNLOCK_ANIMATION_DURATION_MS + CANNED_UNLOCK_START_DELAY,
|
UNLOCK_ANIMATION_DURATION_MS + CANNED_UNLOCK_START_DELAY,
|
||||||
0 /* startDelay */)
|
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
|
launcherPreparedForUnlock = false
|
||||||
} else {
|
} else {
|
||||||
@@ -604,11 +617,23 @@ class KeyguardUnlockAnimationController @Inject constructor(
|
|||||||
private fun unlockToLauncherWithInWindowAnimations() {
|
private fun unlockToLauncherWithInWindowAnimations() {
|
||||||
setSurfaceBehindAppearAmount(1f)
|
setSurfaceBehindAppearAmount(1f)
|
||||||
|
|
||||||
|
try {
|
||||||
// Begin the animation, waiting for the shade to animate out.
|
// Begin the animation, waiting for the shade to animate out.
|
||||||
launcherUnlockController?.playUnlockAnimation(
|
launcherUnlockController?.playUnlockAnimation(
|
||||||
true /* unlocked */,
|
true /* unlocked */,
|
||||||
LAUNCHER_ICONS_ANIMATION_DURATION_MS /* duration */,
|
LAUNCHER_ICONS_ANIMATION_DURATION_MS /* duration */,
|
||||||
CANNED_UNLOCK_START_DELAY /* startDelay */)
|
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
|
launcherPreparedForUnlock = false
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user