From 913676d0db61e413d3efb0f314c82c25adcdb159 Mon Sep 17 00:00:00 2001 From: Xiaowen Lei Date: Mon, 31 Oct 2022 23:32:59 +0000 Subject: [PATCH] Use postStartActivityDismissingKeyguard when showOnLockscreen is false. This fixes the issue where the timer app becomes visible when the lockscreen isn't fully dismissed. See b/250476316#comment6, step 2. The relevent code path is the one using intent. But also made the same change for the pending intent code path. Bug: 250476316 Test: click on Smartspace timer on lockscreen. Change-Id: I0ca16b535ff06a80db09640078e9c961fe29a60e --- .../LockscreenSmartspaceController.kt | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceController.kt index e4a8f219236c5..c6911b1ce410f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceController.kt @@ -234,19 +234,24 @@ class LockscreenSmartspaceController @Inject constructor( ssView.setIntentStarter(object : BcSmartspaceDataPlugin.IntentStarter { override fun startIntent(view: View, intent: Intent, showOnLockscreen: Boolean) { - activityStarter.startActivity( - intent, - true, /* dismissShade */ - null, /* launch animator - looks bad with the transparent smartspace bg */ - showOnLockscreen - ) + if (showOnLockscreen) { + activityStarter.startActivity( + intent, + true, /* dismissShade */ + // launch animator - looks bad with the transparent smartspace bg + null, + true + ) + } else { + activityStarter.postStartActivityDismissingKeyguard(intent, 0) + } } override fun startPendingIntent(pi: PendingIntent, showOnLockscreen: Boolean) { if (showOnLockscreen) { pi.send() } else { - activityStarter.startPendingIntentDismissingKeyguard(pi) + activityStarter.postStartActivityDismissingKeyguard(pi) } } })