diff options
author | Matt Pietal <mpietal@google.com> | 2021-04-23 07:52:31 -0400 |
---|---|---|
committer | Matt Pietal <mpietal@google.com> | 2021-04-23 11:51:32 -0400 |
commit | de36555b9fbd5eb20b35087312e69cafcc38e80f (patch) | |
tree | 9db040b99f7bc330671db6102f38b7cf52795413 /packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java | |
parent | dda049457b8ee24237274198256d8e79b85bff09 (diff) |
Smartspace - Support launching intents from lockscreen
Also integrate the FalsingManager, which is important for determining
user intent while on the lockscreen.
Fixes: 186219857
Test: atest KeyguardClockSwitchControllerTest
Change-Id: I22108ec2335bd350fbcaf5d5b90dd3b351011767
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java')
-rw-r--r-- | packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java index f2bebcebb6d6..5559a1818b4b 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java @@ -19,10 +19,12 @@ package com.android.keyguard; import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; +import android.app.PendingIntent; import android.app.WallpaperManager; import android.app.smartspace.SmartspaceConfig; import android.app.smartspace.SmartspaceManager; import android.app.smartspace.SmartspaceSession; +import android.content.Intent; import android.content.res.Resources; import android.text.TextUtils; import android.text.format.DateFormat; @@ -39,8 +41,11 @@ import com.android.systemui.SystemUIFactory; import com.android.systemui.broadcast.BroadcastDispatcher; import com.android.systemui.colorextraction.SysuiColorExtractor; import com.android.systemui.dagger.qualifiers.Main; +import com.android.systemui.plugins.ActivityStarter; import com.android.systemui.plugins.BcSmartspaceDataPlugin; +import com.android.systemui.plugins.BcSmartspaceDataPlugin.IntentStarter; import com.android.systemui.plugins.ClockPlugin; +import com.android.systemui.plugins.FalsingManager; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.statusbar.FeatureFlags; import com.android.systemui.statusbar.notification.AnimatableProperty; @@ -87,6 +92,8 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS private SmartspaceSession.OnTargetsAvailableListener mSmartspaceCallback; private int mWallpaperTextColor; private ConfigurationController mConfigurationController; + private ActivityStarter mActivityStarter; + private FalsingManager mFalsingManager; /** * Listener for changes to the color palette. @@ -138,7 +145,9 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS @Main Executor uiExecutor, BatteryController batteryController, ConfigurationController configurationController, - SystemUIFactory systemUIFactory) { + SystemUIFactory systemUIFactory, + ActivityStarter activityStarter, + FalsingManager falsingManager) { super(keyguardClockSwitch); mStatusBarStateController = statusBarStateController; mColorExtractor = colorExtractor; @@ -151,6 +160,8 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS mBatteryController = batteryController; mConfigurationController = configurationController; mSystemUIFactory = systemUIFactory; + mActivityStarter = activityStarter; + mFalsingManager = falsingManager; } /** @@ -200,6 +211,16 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS mSmartspaceView = smartspaceDataPlugin.getView(mView); mSmartspaceView.registerDataProvider(smartspaceDataPlugin); + mSmartspaceView.setIntentStarter(new IntentStarter() { + public void startIntent(View v, Intent i) { + mActivityStarter.startActivity(i, true /* dismissShade */); + } + + public void startPendingIntent(PendingIntent pi) { + mActivityStarter.startPendingIntentDismissingKeyguard(pi); + } + }); + mSmartspaceView.setFalsingManager(mFalsingManager); updateWallpaperColor(); View asView = (View) mSmartspaceView; |