From 7db0e2e38171e7ffc1357a1c02db618d933bb1f7 Mon Sep 17 00:00:00 2001 From: Matt Pietal Date: Mon, 19 Apr 2021 15:18:57 -0400 Subject: [PATCH] Smartspace - Fade out secondary cards Pass dozeAmount values to the smartspace library to allow the lib to make decisions regarding content on both AOD and Lockscreen Fixes: 185598979 Test: manual, multiple smartspace cards Change-Id: Ic7bc2ba238b22794a33e6db18c1aae0fa7c96e0b --- .../plugins/BcSmartspaceDataPlugin.java | 8 ++++++ .../KeyguardClockSwitchController.java | 25 ++++++------------- .../KeyguardClockSwitchControllerTest.java | 2 ++ 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/packages/SystemUI/plugin/bcsmartspace/src/com/android/systemui/plugins/BcSmartspaceDataPlugin.java b/packages/SystemUI/plugin/bcsmartspace/src/com/android/systemui/plugins/BcSmartspaceDataPlugin.java index 53ff9f0e8c0b8..4fe48c9dbdda2 100644 --- a/packages/SystemUI/plugin/bcsmartspace/src/com/android/systemui/plugins/BcSmartspaceDataPlugin.java +++ b/packages/SystemUI/plugin/bcsmartspace/src/com/android/systemui/plugins/BcSmartspaceDataPlugin.java @@ -59,6 +59,14 @@ public interface BcSmartspaceDataPlugin extends Plugin { interface SmartspaceView { void registerDataProvider(BcSmartspaceDataPlugin plugin); + /** + * Primary color for unprotected text + */ void setPrimaryTextColor(int color); + + /** + * Range [0.0 - 1.0] when transitioning from Lockscreen to/from AOD + */ + void setDozeAmount(float amount); } } diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java index 96421f3a49819..f2bebcebb6d65 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java @@ -24,7 +24,6 @@ import android.app.smartspace.SmartspaceConfig; import android.app.smartspace.SmartspaceManager; import android.app.smartspace.SmartspaceSession; import android.content.res.Resources; -import android.graphics.Color; import android.text.TextUtils; import android.text.format.DateFormat; import android.view.View; @@ -33,7 +32,6 @@ import android.widget.RelativeLayout; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.colorextraction.ColorExtractor; -import com.android.internal.graphics.ColorUtils; import com.android.keyguard.clock.ClockManager; import com.android.settingslib.Utils; import com.android.systemui.R; @@ -87,9 +85,7 @@ public class KeyguardClockSwitchController extends ViewController