From 94d9200101e0ed831a2b4312f605b2e552d04b3d Mon Sep 17 00:00:00 2001 From: Robin Lee Date: Fri, 12 May 2023 09:05:01 +0000 Subject: [PATCH] Check null taskInfo for occlude transitions KeyguardService.wrap() is liberal with what it counts as an "app". The first item in the apps list might not have a taskInfo if it's not a Task, which causes a crash when unlocking the device for the first time. Change-Id: I479b05a5da896a166a375d30fdf050dc87448f3c Test: atest android.platform.test.scenario.sysui.lockscreen Bug: 274954192 --- .../com/android/systemui/keyguard/KeyguardViewMediator.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index ddc12c9f51050..19c7013a9bce6 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -1003,7 +1003,8 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, } final RemoteAnimationTarget primary = apps[0]; - final boolean isDream = (apps[0].taskInfo.topActivityType + final boolean isDream = (apps[0].taskInfo != null + && apps[0].taskInfo.topActivityType == WindowConfiguration.ACTIVITY_TYPE_DREAM); if (!isDream) { Log.w(TAG, "The occluding app isn't Dream; " @@ -1103,7 +1104,8 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, } final RemoteAnimationTarget primary = apps[0]; - final boolean isDream = (apps[0].taskInfo.topActivityType + final boolean isDream = (apps[0].taskInfo != null + && apps[0].taskInfo.topActivityType == WindowConfiguration.ACTIVITY_TYPE_DREAM); final SyncRtSurfaceTransactionApplier applier =