summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Lucas Dupin <dupin@google.com> 2020-12-02 15:59:55 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2020-12-02 15:59:55 +0000
commit485e78b4cbc08939ccded3669403c5192f43a53e (patch)
treeea633c942bfd81e3aedb2628df0f84cf461292ba
parent4ccbda59f51bda078471b1ec8f5c61ec5b454904 (diff)
parent7b8636fdb0dfc5ef727365cdf42a2fb56bdffeb2 (diff)
Merge "1/N The road to Material NEXT (bouncer and shade)"
-rw-r--r--core/java/android/app/Notification.java24
-rw-r--r--core/java/com/android/internal/widget/LockPatternView.java14
-rw-r--r--core/res/res/values-night/colors.xml3
-rw-r--r--core/res/res/values/colors.xml2
-rw-r--r--core/res/res/values/colors_device_defaults.xml8
-rw-r--r--core/res/res/values/symbols.xml1
-rw-r--r--packages/SystemUI/res-keyguard/color/notification_background_dimmed_color.xml (renamed from packages/SystemUI/res/color/background_protect_secondary.xml)5
-rw-r--r--packages/SystemUI/res-keyguard/drawable/kg_emergency_button_background.xml4
-rw-r--r--packages/SystemUI/res-keyguard/layout/keyguard_password_view.xml6
-rw-r--r--packages/SystemUI/res-keyguard/layout/keyguard_pin_view.xml3
-rw-r--r--packages/SystemUI/res-keyguard/layout/keyguard_sim_pin_view.xml1
-rw-r--r--packages/SystemUI/res-keyguard/layout/keyguard_sim_puk_view.xml1
-rw-r--r--packages/SystemUI/res-keyguard/values/styles.xml35
-rw-r--r--packages/SystemUI/res/color/pin_delete_color.xml2
-rw-r--r--packages/SystemUI/res/color/pin_divider_color.xml2
-rw-r--r--packages/SystemUI/res/color/qs_background_dark.xml2
-rw-r--r--packages/SystemUI/res/drawable/notification_guts_bg.xml2
-rw-r--r--packages/SystemUI/res/drawable/notification_material_bg.xml2
-rw-r--r--packages/SystemUI/res/drawable/notification_material_bg_dim.xml2
-rw-r--r--packages/SystemUI/res/layout/app_ops_info.xml2
-rw-r--r--packages/SystemUI/res/layout/feedback_info.xml2
-rw-r--r--packages/SystemUI/res/layout/notification_conversation_info.xml2
-rw-r--r--packages/SystemUI/res/layout/notification_guts.xml3
-rw-r--r--packages/SystemUI/res/layout/notification_snooze.xml2
-rw-r--r--packages/SystemUI/res/layout/status_bar_notification_section_header.xml1
-rw-r--r--packages/SystemUI/res/values-night/colors.xml11
-rw-r--r--packages/SystemUI/res/values/colors.xml9
-rw-r--r--packages/SystemUI/res/values/styles.xml9
-rw-r--r--packages/SystemUI/src/com/android/keyguard/EmergencyButton.java12
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java9
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardInputViewController.java14
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardMessageArea.java8
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardMessageAreaController.java7
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardPasswordViewController.java21
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardPatternViewController.java12
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java30
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardPinViewController.java6
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java28
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardSecurityViewFlipperController.java9
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardSimPinViewController.java2
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardSimPukViewController.java2
-rw-r--r--packages/SystemUI/src/com/android/keyguard/NumPadKey.java22
-rw-r--r--packages/SystemUI/src/com/android/keyguard/PasswordTextView.java14
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/MediaNotificationProcessor.java5
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationView.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGuts.java5
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationViewWrapper.java5
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java12
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java10
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java7
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/LockscreenLockIconController.java41
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java56
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java3
-rw-r--r--packages/SystemUI/tests/src/com/android/keyguard/KeyguardSecurityContainerControllerTest.java7
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java17
-rw-r--r--services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java10
56 files changed, 356 insertions, 184 deletions
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index d5977e7711fd..a1135809fd4c 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -5932,8 +5932,7 @@ public class Notification implements Parcelable
}
int color;
- int background = mContext.getColor(
- com.android.internal.R.color.notification_material_background_color);
+ int background = obtainBackgroundColor();
if (rawColor == COLOR_DEFAULT) {
ensureColors(p);
color = ContrastColorUtil.resolveDefaultColor(mContext, background, mInNightMode);
@@ -5966,8 +5965,7 @@ public class Notification implements Parcelable
if (mNeutralColor != COLOR_INVALID) {
return mNeutralColor;
}
- int background = mContext.getColor(
- com.android.internal.R.color.notification_material_background_color);
+ int background = obtainBackgroundColor();
mNeutralColor = ContrastColorUtil.resolveDefaultColor(mContext, background,
mInNightMode);
if (Color.alpha(mNeutralColor) < 255) {
@@ -6118,6 +6116,21 @@ public class Notification implements Parcelable
return mN;
}
+ private @ColorInt int obtainBackgroundColor() {
+ int defaultColor = mInNightMode ? Color.BLACK : Color.WHITE;
+ Resources.Theme theme = mContext.getTheme();
+ if (theme == null) {
+ return defaultColor;
+ }
+ TypedArray ta = theme.obtainStyledAttributes(new int[]{R.attr.colorBackground});
+ if (ta == null) {
+ return defaultColor;
+ }
+ int background = ta.getColor(0, defaultColor);
+ ta.recycle();
+ return background;
+ }
+
/**
* Apply this Builder to an existing {@link Notification} object.
*
@@ -6251,8 +6264,7 @@ public class Notification implements Parcelable
private int resolveBackgroundColor(StandardTemplateParams p) {
int backgroundColor = getBackgroundColor(p);
if (backgroundColor == COLOR_DEFAULT) {
- backgroundColor = mContext.getColor(
- com.android.internal.R.color.notification_material_background_color);
+ backgroundColor = obtainBackgroundColor();
}
return backgroundColor;
}
diff --git a/core/java/com/android/internal/widget/LockPatternView.java b/core/java/com/android/internal/widget/LockPatternView.java
index 4ddc782aacb4..bad21d28416b 100644
--- a/core/java/com/android/internal/widget/LockPatternView.java
+++ b/core/java/com/android/internal/widget/LockPatternView.java
@@ -1090,6 +1090,20 @@ public class LockPatternView extends View {
}
}
+ /**
+ * Change theme colors
+ * @param regularColor The dot color
+ * @param successColor Color used when pattern is correct
+ * @param errorColor Color used when authentication fails
+ */
+ public void setColors(int regularColor, int successColor, int errorColor) {
+ mRegularColor = regularColor;
+ mErrorColor = errorColor;
+ mSuccessColor = successColor;
+ mPathPaint.setColor(regularColor);
+ invalidate();
+ }
+
private float getCenterXForColumn(int column) {
return mPaddingLeft + column * mSquareWidth + mSquareWidth / 2f;
}
diff --git a/core/res/res/values-night/colors.xml b/core/res/res/values-night/colors.xml
index 39cdce9cc46b..29f2b6f14b57 100644
--- a/core/res/res/values-night/colors.xml
+++ b/core/res/res/values-night/colors.xml
@@ -26,9 +26,6 @@
<color name="notification_default_color_dark">#ddffffff</color>
- <!-- The background color of a notification card. -->
- <color name="notification_material_background_color">@color/black</color>
-
<color name="chooser_row_divider">@color/list_divider_color_dark</color>
<color name="chooser_gradient_background">@color/loading_gradient_background_color_dark</color>
<color name="chooser_gradient_highlight">@color/loading_gradient_highlight_color_dark</color>
diff --git a/core/res/res/values/colors.xml b/core/res/res/values/colors.xml
index 1242c6dc8217..0079d8cd0276 100644
--- a/core/res/res/values/colors.xml
+++ b/core/res/res/values/colors.xml
@@ -143,8 +143,6 @@
<color name="notification_default_color_dark">@color/primary_text_default_material_light</color>
<color name="notification_default_color_light">#a3202124</color>
- <color name="notification_material_background_color">#ffffffff</color>
-
<color name="notification_default_color">#757575</color> <!-- Gray 600 -->
<color name="notification_action_button_text_color">@color/notification_default_color</color>
diff --git a/core/res/res/values/colors_device_defaults.xml b/core/res/res/values/colors_device_defaults.xml
index 7a8f411992ce..310ca893ac39 100644
--- a/core/res/res/values/colors_device_defaults.xml
+++ b/core/res/res/values/colors_device_defaults.xml
@@ -37,10 +37,10 @@
<color name="accent_device_default_dark">@color/accent_material_dark</color>
<color name="accent_device_default">@color/accent_device_default_light</color>
- <color name="background_device_default_dark">@color/background_material_dark</color>
- <color name="background_device_default_light">@color/background_material_light</color>
- <color name="background_floating_device_default_dark">@color/background_floating_material_dark</color>
- <color name="background_floating_device_default_light">@color/background_floating_material_light</color>
+ <color name="background_device_default_dark">#1A1A1A</color>
+ <color name="background_device_default_light">#F2F2F2</color>
+ <color name="background_floating_device_default_dark">#0D0D0D</color>
+ <color name="background_floating_device_default_light">#CCCCCC</color>
<!-- Error color -->
<color name="error_color_device_default_dark">@color/error_color_material_dark</color>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 84556d41a07e..56284ff41bf9 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -3002,7 +3002,6 @@
<java-symbol type="string" name="usb_mtp_launch_notification_description" />
<java-symbol type="color" name="notification_action_list" />
- <java-symbol type="color" name="notification_material_background_color" />
<!-- Resolver target actions -->
<java-symbol type="array" name="resolver_target_actions_pin" />
diff --git a/packages/SystemUI/res/color/background_protect_secondary.xml b/packages/SystemUI/res-keyguard/color/notification_background_dimmed_color.xml
index 97744dbe9190..3345e6e42500 100644
--- a/packages/SystemUI/res/color/background_protect_secondary.xml
+++ b/packages/SystemUI/res-keyguard/color/notification_background_dimmed_color.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
- ~ Copyright (C) 2017 The Android Open Source Project
+ ~ Copyright (C) 2020 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
@@ -14,7 +14,6 @@
~ See the License for the specific language governing permissions and
~ limitations under the License
-->
-
<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:color="?attr/wallpaperTextColorSecondary" />
+ <item android:alpha="0.7" android:color="?android:attr/colorBackground" />
</selector> \ No newline at end of file
diff --git a/packages/SystemUI/res-keyguard/drawable/kg_emergency_button_background.xml b/packages/SystemUI/res-keyguard/drawable/kg_emergency_button_background.xml
index cc2089f69287..99c70a54a3cd 100644
--- a/packages/SystemUI/res-keyguard/drawable/kg_emergency_button_background.xml
+++ b/packages/SystemUI/res-keyguard/drawable/kg_emergency_button_background.xml
@@ -19,13 +19,13 @@
<item android:id="@android:id/background">
<shape
android:color="@android:color/transparent">
- <stroke android:width="1dp" android:color="?attr/wallpaperTextColorSecondary"/>
+ <stroke android:width="1dp" android:color="?android:attr/textColorSecondary"/>
<corners android:radius="24dp"/>
</shape>
</item>
<item android:id="@android:id/mask">
<shape android:shape="rectangle">
- <solid android:color="?attr/wallpaperTextColorSecondary"/>
+ <solid android:color="?android:attr/textColorSecondary"/>
<corners android:radius="24dp"/>
</shape>
</item>
diff --git a/packages/SystemUI/res-keyguard/layout/keyguard_password_view.xml b/packages/SystemUI/res-keyguard/layout/keyguard_password_view.xml
index b06d6a989cb8..e1550aa0c87c 100644
--- a/packages/SystemUI/res-keyguard/layout/keyguard_password_view.xml
+++ b/packages/SystemUI/res-keyguard/layout/keyguard_password_view.xml
@@ -34,7 +34,7 @@
android:layout_weight="7"
/>
- <!-- Password entry field -->
+ <!-- Password entry field -->
<FrameLayout
android:layout_height="wrap_content"
android:layout_width="280dp"
@@ -51,9 +51,9 @@
android:textStyle="normal"
android:inputType="textPassword"
android:textSize="16sp"
- android:textColor="?attr/wallpaperTextColor"
android:textAppearance="?android:attr/textAppearanceMedium"
android:imeOptions="flagForceAscii|actionDone"
+ android:textCursorDrawable="@null"
android:maxLength="500"
/>
@@ -65,7 +65,7 @@
android:contentDescription="@string/accessibility_ime_switch_button"
android:clickable="true"
android:padding="8dip"
- android:tint="@color/background_protected"
+ android:tint="?android:attr/textColorPrimary"
android:layout_gravity="end|center_vertical"
android:background="?android:attr/selectableItemBackground"
android:visibility="gone"
diff --git a/packages/SystemUI/res-keyguard/layout/keyguard_pin_view.xml b/packages/SystemUI/res-keyguard/layout/keyguard_pin_view.xml
index a75b35d117b6..87c98d2e9597 100644
--- a/packages/SystemUI/res-keyguard/layout/keyguard_pin_view.xml
+++ b/packages/SystemUI/res-keyguard/layout/keyguard_pin_view.xml
@@ -46,11 +46,10 @@
android:id="@+id/pinEntry"
android:layout_width="@dimen/keyguard_security_width"
android:layout_height="match_parent"
- android:gravity="center"
+ style="@style/Widget.TextView.Password"
android:layout_centerHorizontal="true"
android:layout_marginRight="72dp"
androidprv:scaledTextSize="@integer/scaled_password_text_size"
- android:textColor="?attr/wallpaperTextColor"
android:contentDescription="@string/keyguard_accessibility_pin_area"
/>
<View
diff --git a/packages/SystemUI/res-keyguard/layout/keyguard_sim_pin_view.xml b/packages/SystemUI/res-keyguard/layout/keyguard_sim_pin_view.xml
index cd61a3775bf7..912d7bbf7ef5 100644
--- a/packages/SystemUI/res-keyguard/layout/keyguard_sim_pin_view.xml
+++ b/packages/SystemUI/res-keyguard/layout/keyguard_sim_pin_view.xml
@@ -64,7 +64,6 @@
android:layout_centerHorizontal="true"
android:layout_marginRight="72dp"
androidprv:scaledTextSize="@integer/scaled_password_text_size"
- android:textColor="?attr/wallpaperTextColor"
android:contentDescription="@string/keyguard_accessibility_sim_pin_area"
/>
<View
diff --git a/packages/SystemUI/res-keyguard/layout/keyguard_sim_puk_view.xml b/packages/SystemUI/res-keyguard/layout/keyguard_sim_puk_view.xml
index bb757356f2b9..81b49648ab62 100644
--- a/packages/SystemUI/res-keyguard/layout/keyguard_sim_puk_view.xml
+++ b/packages/SystemUI/res-keyguard/layout/keyguard_sim_puk_view.xml
@@ -65,7 +65,6 @@
android:layout_centerHorizontal="true"
android:layout_marginRight="72dp"
androidprv:scaledTextSize="@integer/scaled_password_text_size"
- android:textColor="?attr/wallpaperTextColor"
android:contentDescription="@string/keyguard_accessibility_sim_puk_area"
/>
<View
diff --git a/packages/SystemUI/res-keyguard/values/styles.xml b/packages/SystemUI/res-keyguard/values/styles.xml
index 401f3e3e0685..bc48e8fe3eea 100644
--- a/packages/SystemUI/res-keyguard/values/styles.xml
+++ b/packages/SystemUI/res-keyguard/values/styles.xml
@@ -20,41 +20,46 @@
<resources>
<!-- Keyguard PIN pad styles -->
<style name="Keyguard.TextView" parent="@android:style/Widget.DeviceDefault.TextView">
- <item name="android:textColor">?attr/wallpaperTextColorSecondary</item>
<item name="android:textSize">@dimen/kg_status_line_font_size</item>
</style>
<style name="Keyguard.TextView.EmergencyButton" parent="Theme.SystemUI">
- <item name="android:textColor">?attr/wallpaperTextColorSecondary</item>
+ <item name="android:textColor">?android:attr/textColorSecondary</item>
<item name="android:textSize">14dp</item>
<item name="android:background">@drawable/kg_emergency_button_background</item>
<item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
<item name="android:paddingLeft">12dp</item>
<item name="android:paddingRight">12dp</item>
</style>
- <style name="Widget.TextView.NumPadKey" parent="@android:style/Widget.TextView">
+ <style name="Widget.TextView.NumPadKey" parent="@android:style/Widget.DeviceDefault.TextView">
<item name="android:singleLine">true</item>
<item name="android:gravity">center_horizontal|center_vertical</item>
<item name="android:background">@null</item>
<item name="android:textSize">32sp</item>
+ <item name="android:textColor">?android:attr/textColorPrimary</item>
<item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
- <item name="android:textColor">?attr/wallpaperTextColor</item>
<item name="android:paddingBottom">-16dp</item>
+ <item name="android:colorControlHighlight">?android:attr/textColorPrimary</item>
+ </style>
+ <style name="Widget.TextView.Password" parent="@android:style/Widget.TextView">
+ <item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
+ <item name="android:gravity">center</item>
+ <item name="android:textColor">?android:attr/textColorPrimary</item>
</style>
- <style name="Keyguard.ImageButton.NumPadDelete" parent="@android:style/Widget.ImageButton">
+ <style name="Keyguard.ImageButton.NumPadDelete" parent="@android:style/Widget.DeviceDefault.ImageButton">
<item name="android:src">@drawable/ic_backspace_black_24dp</item>
<item name="android:paddingBottom">11sp</item>
- <item name="android:tint">@color/pin_delete_color</item>
+ <item name="android:tint">?android:attr/textColorSecondary</item>
<item name="android:tintMode">src_in</item>
<item name="android:src">@drawable/ic_backspace_black_24dp</item>
</style>
- <style name="Keyguard.ImageButton.NumPadEnter" parent="@android:style/Widget.ImageButton">
+ <style name="Keyguard.ImageButton.NumPadEnter" parent="@android:style/Widget.DeviceDefault.ImageButton">
<item name="android:src">@drawable/ic_keyboard_tab_36dp</item>
<item name="android:paddingBottom">11sp</item>
</style>
- <style name="Widget.TextView.NumPadKey.Klondike" parent="Widget.TextView.NumPadKey">
+ <style name="Widget.TextView.NumPadKey.Klondike">
<item name="android:textSize">12sp</item>
<item name="android:fontFamily">@*android:string/config_bodyFontFamily</item>
- <item name="android:textColor">?attr/wallpaperTextColorSecondary</item>
+ <item name="android:textColor">?android:attr/textColorSecondary</item>
<item name="android:paddingBottom">0dp</item>
</style>
@@ -95,15 +100,9 @@
</style>
<style name="PasswordTheme" parent="Theme.SystemUI">
- <item name="android:textColor">?attr/wallpaperTextColor</item>
- <item name="android:colorControlNormal">?attr/wallpaperTextColor</item>
- <item name="android:colorControlActivated">?attr/wallpaperTextColor</item>
- </style>
-
- <style name="PasswordTheme.Light" parent="Theme.SystemUI.Light">
- <item name="android:textColor">?attr/wallpaperTextColor</item>
- <item name="android:colorControlNormal">?attr/wallpaperTextColor</item>
- <item name="android:colorControlActivated">?attr/wallpaperTextColor</item>
+ <item name="android:textColor">?android:attr/textColorPrimary</item>
+ <item name="android:colorControlNormal">?android:attr/textColorPrimary</item>
+ <item name="android:colorControlActivated">?android:attr/textColorPrimary</item>
</style>
<style name="Theme.SystemUI.KeyguardPresentation">
diff --git a/packages/SystemUI/res/color/pin_delete_color.xml b/packages/SystemUI/res/color/pin_delete_color.xml
index 7d4f1321d52f..c1b4cf87e923 100644
--- a/packages/SystemUI/res/color/pin_delete_color.xml
+++ b/packages/SystemUI/res/color/pin_delete_color.xml
@@ -15,5 +15,5 @@
~ limitations under the License
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:alpha="0.61" android:color="?attr/wallpaperTextColor" />
+ <item android:alpha="0.61" android:color="?android:attr/textColor" />
</selector> \ No newline at end of file
diff --git a/packages/SystemUI/res/color/pin_divider_color.xml b/packages/SystemUI/res/color/pin_divider_color.xml
index aff23171eee3..e05772fab8b2 100644
--- a/packages/SystemUI/res/color/pin_divider_color.xml
+++ b/packages/SystemUI/res/color/pin_divider_color.xml
@@ -15,5 +15,5 @@
~ limitations under the License
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:alpha="0.45" android:color="?attr/wallpaperTextColorSecondary" />
+ <item android:alpha="0.45" android:color="?android:attr/textColorSecondary" />
</selector> \ No newline at end of file
diff --git a/packages/SystemUI/res/color/qs_background_dark.xml b/packages/SystemUI/res/color/qs_background_dark.xml
index 24afebde046b..c47959a04fff 100644
--- a/packages/SystemUI/res/color/qs_background_dark.xml
+++ b/packages/SystemUI/res/color/qs_background_dark.xml
@@ -16,5 +16,5 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:alpha="1"
- android:color="?android:attr/colorBackgroundFloating"/>
+ android:color="?android:attr/colorBackground"/>
</selector>
diff --git a/packages/SystemUI/res/drawable/notification_guts_bg.xml b/packages/SystemUI/res/drawable/notification_guts_bg.xml
index 2fe6c7b2d1a2..d62687883c35 100644
--- a/packages/SystemUI/res/drawable/notification_guts_bg.xml
+++ b/packages/SystemUI/res/drawable/notification_guts_bg.xml
@@ -16,7 +16,7 @@
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android">
- <solid android:color="@color/notification_material_background_color" />
+ <solid android:color="?android:attr/colorBackground" />
<!--The radius is 1dp smaller than the notification one, to avoid aliasing bugs on the corners -->
<corners android:radius="1dp" />
</shape>
diff --git a/packages/SystemUI/res/drawable/notification_material_bg.xml b/packages/SystemUI/res/drawable/notification_material_bg.xml
index ae456631c4f1..1e9be2fb9b05 100644
--- a/packages/SystemUI/res/drawable/notification_material_bg.xml
+++ b/packages/SystemUI/res/drawable/notification_material_bg.xml
@@ -19,7 +19,7 @@
android:color="@color/notification_ripple_untinted_color">
<item>
<shape>
- <solid android:color="@color/notification_material_background_color" />
+ <solid android:color="?android:attr/colorBackground" />
</shape>
</item>
</ripple> \ No newline at end of file
diff --git a/packages/SystemUI/res/drawable/notification_material_bg_dim.xml b/packages/SystemUI/res/drawable/notification_material_bg_dim.xml
index b6a8b70bb3e0..1127d3c247fd 100644
--- a/packages/SystemUI/res/drawable/notification_material_bg_dim.xml
+++ b/packages/SystemUI/res/drawable/notification_material_bg_dim.xml
@@ -17,7 +17,7 @@
<ripple xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
- <solid android:color="@color/notification_material_background_dimmed_color" />
+ <solid android:color="@color/notification_background_dimmed_color" />
</shape>
</item>
</ripple>
diff --git a/packages/SystemUI/res/layout/app_ops_info.xml b/packages/SystemUI/res/layout/app_ops_info.xml
index 667c857b6967..ecf572ba4a5c 100644
--- a/packages/SystemUI/res/layout/app_ops_info.xml
+++ b/packages/SystemUI/res/layout/app_ops_info.xml
@@ -26,7 +26,7 @@
android:orientation="vertical"
android:paddingStart="@*android:dimen/notification_content_margin_start"
android:paddingEnd="@*android:dimen/notification_content_margin_end"
- android:background="@color/notification_material_background_color"
+ android:background="?android:attr/colorBackground"
android:theme="@*android:style/Theme.DeviceDefault.Light">
<!-- Package Info -->
diff --git a/packages/SystemUI/res/layout/feedback_info.xml b/packages/SystemUI/res/layout/feedback_info.xml
index 5e847a28558e..7047c1b21961 100644
--- a/packages/SystemUI/res/layout/feedback_info.xml
+++ b/packages/SystemUI/res/layout/feedback_info.xml
@@ -26,7 +26,7 @@
android:orientation="vertical"
android:paddingStart="@*android:dimen/notification_content_margin_start"
android:paddingEnd="@*android:dimen/notification_content_margin_end"
- android:background="@color/notification_material_background_color"
+ android:background="?android:attr/colorBackground"
android:theme="@*android:style/Theme.DeviceDefault.Light">
<!-- Package Info -->
diff --git a/packages/SystemUI/res/layout/notification_conversation_info.xml b/packages/SystemUI/res/layout/notification_conversation_info.xml
index 10ad8291636e..fcc1aed65470 100644
--- a/packages/SystemUI/res/layout/notification_conversation_info.xml
+++ b/packages/SystemUI/res/layout/notification_conversation_info.xml
@@ -24,7 +24,7 @@
android:clipChildren="true"
android:clipToPadding="true"
android:orientation="vertical"
- android:background="@color/notification_material_background_color"
+ android:background="?android:attr/colorBackground"
android:paddingStart="12dp">
<!-- Package Info -->
diff --git a/packages/SystemUI/res/layout/notification_guts.xml b/packages/SystemUI/res/layout/notification_guts.xml
index 5399f57c322f..fb75dd348a41 100644
--- a/packages/SystemUI/res/layout/notification_guts.xml
+++ b/packages/SystemUI/res/layout/notification_guts.xml
@@ -22,5 +22,4 @@
android:focusable="true"
android:id="@+id/notification_guts"
android:visibility="gone"
- android:gravity="top|start"
- android:theme="@*android:style/Theme.DeviceDefault.Light"/>
+ android:gravity="top|start"/>
diff --git a/packages/SystemUI/res/layout/notification_snooze.xml b/packages/SystemUI/res/layout/notification_snooze.xml
index 253bc328c5b8..dc9d92001351 100644
--- a/packages/SystemUI/res/layout/notification_snooze.xml
+++ b/packages/SystemUI/res/layout/notification_snooze.xml
@@ -20,7 +20,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
- android:background="@color/notification_material_background_color"
+ android:background="?android:attr/colorBackground"
android:theme="@style/Theme.SystemUI">
<RelativeLayout
diff --git a/packages/SystemUI/res/layout/status_bar_notification_section_header.xml b/packages/SystemUI/res/layout/status_bar_notification_section_header.xml
index b5822c889f1c..e33f186dcbb7 100644
--- a/packages/SystemUI/res/layout/status_bar_notification_section_header.xml
+++ b/packages/SystemUI/res/layout/status_bar_notification_section_header.xml
@@ -58,7 +58,6 @@
android:src="@drawable/status_bar_notification_section_header_clear_btn"
android:contentDescription="@string/accessibility_notification_section_header_gentle_clear_all"
android:scaleType="center"
- android:tint="?attr/wallpaperTextColor"
android:tintMode="src_in"
android:visibility="gone"
android:forceHasOverlappingRendering="false"
diff --git a/packages/SystemUI/res/values-night/colors.xml b/packages/SystemUI/res/values-night/colors.xml
index cb9e178de243..8cc747bf04d6 100644
--- a/packages/SystemUI/res/values-night/colors.xml
+++ b/packages/SystemUI/res/values-night/colors.xml
@@ -17,22 +17,13 @@
NOTE: You might also want to edit: core/res/res/values-night/*.xml
-->
<resources>
- <!-- The color of the material notification background -->
- <color name="notification_material_background_color">@*android:color/notification_material_background_color</color>
-
<!-- The color of the legacy notifications with customs backgrounds (gingerbread and lollipop.)
It's fine to override this color since at that point the shade was dark. -->
- <color name="notification_legacy_background_color">@*android:color/notification_material_background_color</color>
-
- <!-- The color of the material notification background when dimmed -->
- <color name="notification_material_background_dimmed_color">#aa000000</color>
+ <color name="notification_legacy_background_color">@color/GM2_grey_900</color>
<!-- The color of the dividing line between grouped notifications while . -->
<color name="notification_divider_color">#212121</color>
- <!-- The background color of the notification shade -->
- <color name="notification_shade_background_color">@color/GM2_grey_900</color>
-
<!-- The color of the gear shown behind a notification -->
<color name="notification_gear_color">@color/GM2_grey_500</color>
diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml
index be36316d013c..c51e0bf2c31b 100644
--- a/packages/SystemUI/res/values/colors.xml
+++ b/packages/SystemUI/res/values/colors.xml
@@ -80,21 +80,12 @@
<!-- The color of the legacy notification background -->
<color name="notification_legacy_background_color">#ff1a1a1a</color>
- <!-- The color of the material notification background -->
- <color name="notification_material_background_color">@*android:color/notification_material_background_color</color>
-
- <!-- The color of the material notification background when dimmed -->
- <color name="notification_material_background_dimmed_color">#ccffffff</color>
-
<!-- The color of the material notification background when dark -->
<color name="notification_material_background_dark_color">#ff333333</color>
<!-- The color of the dividing line between grouped notifications. -->
<color name="notification_divider_color">#FF616161</color>
- <!-- The background color of the notification shade -->
- <color name="notification_shade_background_color">@color/GM2_grey_200</color>
-
<!-- The color of the ripples on the untinted notifications -->
<color name="notification_ripple_untinted_color">#28000000</color>
diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml
index f38e653190b0..0697c5c0084c 100644
--- a/packages/SystemUI/res/values/styles.xml
+++ b/packages/SystemUI/res/values/styles.xml
@@ -334,7 +334,6 @@
<item name="wallpaperTextColorSecondary">@*android:color/secondary_text_material_light</item>
<item name="android:colorError">@*android:color/error_color_material_light</item>
<item name="android:colorControlHighlight">#40000000</item>
- <item name="passwordStyle">@style/PasswordTheme.Light</item>
<item name="shadowRadius">0</item>
<!-- Needed for MediaRoute chooser dialog -->
@@ -356,8 +355,8 @@
</style>
<style name="LockPatternStyle">
- <item name="*android:regularColor">?attr/wallpaperTextColor</item>
- <item name="*android:successColor">?attr/wallpaperTextColor</item>
+ <item name="*android:regularColor">?android:attr/textColorPrimary</item>
+ <item name="*android:successColor">?android:attr/textColorPrimary</item>
<item name="*android:errorColor">?android:attr/colorError</item>
</style>
@@ -555,8 +554,8 @@
<style
name="TextAppearance.NotificationSectionHeaderButton"
- parent="@android:style/Widget.Material.Button.Borderless">
- <item name="android:textColor">?attr/wallpaperTextColor</item>
+ parent="@android:style/Widget.DeviceDefault.Button.Borderless">
+ <item name="android:textColor">?android:attr/textColorPrimary</item>
<item name="android:textAllCaps">false</item>
<item name="android:textSize">14sp</item>
<item name="android:minWidth">0dp</item>
diff --git a/packages/SystemUI/src/com/android/keyguard/EmergencyButton.java b/packages/SystemUI/src/com/android/keyguard/EmergencyButton.java
index 487e0d8ea38e..b7d7498e8960 100644
--- a/packages/SystemUI/src/com/android/keyguard/EmergencyButton.java
+++ b/packages/SystemUI/src/com/android/keyguard/EmergencyButton.java
@@ -41,6 +41,7 @@ import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.util.EmergencyAffordanceManager;
import com.android.internal.widget.LockPatternUtils;
+import com.android.settingslib.Utils;
import com.android.systemui.Dependency;
import com.android.systemui.util.EmergencyDialerConstants;
@@ -148,6 +149,17 @@ public class EmergencyButton extends Button {
return super.onTouchEvent(event);
}
+ /**
+ * Reload colors from resources.
+ **/
+ public void reloadColors() {
+ int color = Utils.getColorAttrDefaultColor(getContext(),
+ android.R.attr.textColorSecondary);
+ setTextColor(color);
+ setBackground(getContext()
+ .getDrawable(com.android.systemui.R.drawable.kg_emergency_button_background));
+ }
+
@Override
public boolean performLongClick() {
return super.performLongClick();
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java
index 217cf701b265..5760565aaab1 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java
@@ -20,6 +20,7 @@ import static com.android.internal.util.LatencyTracker.ACTION_CHECK_CREDENTIAL;
import static com.android.internal.util.LatencyTracker.ACTION_CHECK_CREDENTIAL_UNLOCKED;
import static com.android.keyguard.KeyguardAbsKeyInputView.MINIMUM_PASSWORD_LENGTH_BEFORE_REPORT;
+import android.annotation.CallSuper;
import android.content.res.ColorStateList;
import android.os.AsyncTask;
import android.os.CountDownTimer;
@@ -87,6 +88,7 @@ public abstract class KeyguardAbsKeyInputViewController<T extends KeyguardAbsKey
@Override
protected void onViewAttached() {
+ super.onViewAttached();
mView.setKeyDownListener(mKeyDownListener);
mView.setEnableHaptics(mLockPatternUtils.isTactileFeedbackEnabled());
EmergencyButton button = mView.findViewById(R.id.emergency_call_button);
@@ -110,6 +112,13 @@ public abstract class KeyguardAbsKeyInputViewController<T extends KeyguardAbsKey
}
}
+ @CallSuper
+ @Override
+ public void reloadColors() {
+ super.reloadColors();
+ mMessageAreaController.reloadColors();
+ }
+
@Override
public boolean needsInput() {
return false;
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardInputViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardInputViewController.java
index fbda818740e8..6aa5e0df3653 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardInputViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardInputViewController.java
@@ -16,6 +16,7 @@
package com.android.keyguard;
+import android.annotation.CallSuper;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.telephony.TelephonyManager;
@@ -24,6 +25,7 @@ import android.view.inputmethod.InputMethodManager;
import com.android.internal.util.LatencyTracker;
import com.android.internal.widget.LockPatternUtils;
import com.android.keyguard.KeyguardSecurityModel.SecurityMode;
+import com.android.systemui.R;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.util.ViewController;
import com.android.systemui.util.concurrency.DelayableExecutor;
@@ -37,6 +39,7 @@ public abstract class KeyguardInputViewController<T extends KeyguardInputView>
private final SecurityMode mSecurityMode;
private final KeyguardSecurityCallback mKeyguardSecurityCallback;
+ private final EmergencyButton mEmergencyButton;
private boolean mPaused;
@@ -68,6 +71,7 @@ public abstract class KeyguardInputViewController<T extends KeyguardInputView>
super(view);
mSecurityMode = securityMode;
mKeyguardSecurityCallback = keyguardSecurityCallback;
+ mEmergencyButton = view == null ? null : view.findViewById(R.id.emergency_call_button);
}
@Override
@@ -112,6 +116,16 @@ public abstract class KeyguardInputViewController<T extends KeyguardInputView>
public void showMessage(CharSequence message, ColorStateList colorState) {
}
+ /**
+ * Reload colors from resources.
+ **/
+ @CallSuper
+ public void reloadColors() {
+ if (mEmergencyButton != null) {
+ mEmergencyButton.reloadColors();
+ }
+ }
+
public void startAppearAnimation() {
mView.startAppearAnimation();
}
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardMessageArea.java b/packages/SystemUI/src/com/android/keyguard/KeyguardMessageArea.java
index 1a0a4370fca4..561ea4075291 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardMessageArea.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardMessageArea.java
@@ -29,6 +29,7 @@ import android.util.TypedValue;
import android.view.View;
import android.widget.TextView;
+import com.android.settingslib.Utils;
import com.android.systemui.R;
import java.lang.ref.WeakReference;
@@ -69,7 +70,7 @@ public class KeyguardMessageArea extends TextView implements SecurityMessageDisp
void onThemeChanged() {
TypedArray array = mContext.obtainStyledAttributes(new int[] {
- R.attr.wallpaperTextColor
+ android.R.attr.textColor
});
ColorStateList newTextColors = ColorStateList.valueOf(array.getColor(0, Color.RED));
array.recycle();
@@ -77,6 +78,11 @@ public class KeyguardMessageArea extends TextView implements SecurityMessageDisp
update();
}
+ void reloadColor() {
+ mDefaultColorState = Utils.getColorAttr(getContext(), android.R.attr.textColorPrimary);
+ update();
+ }
+
void onDensityOrFontScaleChanged() {
TypedArray array = mContext.obtainStyledAttributes(R.style.Keyguard_TextView, new int[] {
android.R.attr.textSize
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardMessageAreaController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardMessageAreaController.java
index 1618e8e58055..6e40f025da50 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardMessageAreaController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardMessageAreaController.java
@@ -93,6 +93,13 @@ public class KeyguardMessageAreaController extends ViewController<KeyguardMessag
mView.setNextMessageColor(colorState);
}
+ /**
+ * Reload colors from resources.
+ **/
+ public void reloadColors() {
+ mView.reloadColor();
+ }
+
/** Factory for creating {@link com.android.keyguard.KeyguardMessageAreaController}. */
public static class Factory {
private final KeyguardUpdateMonitor mKeyguardUpdateMonitor;
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordViewController.java
index d34ea8c5e018..5e339172ca28 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordViewController.java
@@ -16,6 +16,7 @@
package com.android.keyguard;
+import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.os.UserHandle;
import android.text.Editable;
@@ -30,12 +31,14 @@ import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputMethodInfo;
import android.view.inputmethod.InputMethodManager;
import android.view.inputmethod.InputMethodSubtype;
-import android.widget.TextView;
+import android.widget.EditText;
+import android.widget.ImageView;
import android.widget.TextView.OnEditorActionListener;
import com.android.internal.util.LatencyTracker;
import com.android.internal.widget.LockPatternUtils;
import com.android.keyguard.KeyguardSecurityModel.SecurityMode;
+import com.android.settingslib.Utils;
import com.android.systemui.R;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.util.concurrency.DelayableExecutor;
@@ -51,8 +54,8 @@ public class KeyguardPasswordViewController
private final InputMethodManager mInputMethodManager;
private final DelayableExecutor mMainExecutor;
private final boolean mShowImeAtScreenOn;
- private TextView mPasswordEntry;
- private View mSwitchImeButton;
+ private EditText mPasswordEntry;
+ private ImageView mSwitchImeButton;
private final OnEditorActionListener mOnEditorActionListener = (v, actionId, event) -> {
// Check if this was the result of hitting the enter key
@@ -88,6 +91,18 @@ public class KeyguardPasswordViewController
}
};
+ @Override
+ public void reloadColors() {
+ super.reloadColors();
+ int textColor = Utils.getColorAttr(mView.getContext(),
+ android.R.attr.textColorPrimary).getDefaultColor();
+ mPasswordEntry.setTextColor(textColor);
+ mPasswordEntry.setHighlightColor(textColor);
+ mPasswordEntry.setBackgroundTintList(ColorStateList.valueOf(textColor));
+ mPasswordEntry.setForegroundTintList(ColorStateList.valueOf(textColor));
+ mSwitchImeButton.setImageTintList(ColorStateList.valueOf(textColor));
+ }
+
protected KeyguardPasswordViewController(KeyguardPasswordView view,
KeyguardUpdateMonitor keyguardUpdateMonitor,
SecurityMode securityMode,
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPatternViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPatternViewController.java
index 730c17787908..2aaf748e2415 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardPatternViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPatternViewController.java
@@ -33,6 +33,7 @@ import com.android.internal.widget.LockPatternView.Cell;
import com.android.internal.widget.LockscreenCredential;
import com.android.keyguard.EmergencyButton.EmergencyButtonCallback;
import com.android.keyguard.KeyguardSecurityModel.SecurityMode;
+import com.android.settingslib.Utils;
import com.android.systemui.R;
import java.util.List;
@@ -197,6 +198,7 @@ public class KeyguardPatternViewController
@Override
protected void onViewAttached() {
+ super.onViewAttached();
mLockPatternView.setOnPatternListener(new UnlockPatternListener());
mLockPatternView.setSaveEnabled(false);
mLockPatternView.setInStealthMode(!mLockPatternUtils.isVisiblePatternEnabled(
@@ -252,6 +254,16 @@ public class KeyguardPatternViewController
}
@Override
+ public void reloadColors() {
+ super.reloadColors();
+ mMessageAreaController.reloadColors();
+ int textColor = Utils.getColorAttr(mLockPatternView.getContext(),
+ android.R.attr.textColorPrimary).getDefaultColor();
+ int errorColor = Utils.getColorError(mLockPatternView.getContext()).getDefaultColor();
+ mLockPatternView.setColors(textColor, textColor, errorColor);
+ }
+
+ @Override
public void onPause() {
super.onPause();
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java
index 7fa43116a7b1..4ddfccb21c73 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java
@@ -24,12 +24,16 @@ import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_TIMEOUT;
import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_USER_REQUEST;
import android.content.Context;
+import android.content.res.ColorStateList;
import android.graphics.Rect;
import android.util.AttributeSet;
+import android.view.ContextThemeWrapper;
import android.view.KeyEvent;
import android.view.View;
+import android.widget.ImageButton;
import com.android.internal.widget.LockscreenCredential;
+import com.android.settingslib.Utils;
import com.android.systemui.R;
/**
@@ -39,8 +43,9 @@ public abstract class KeyguardPinBasedInputView extends KeyguardAbsKeyInputView
protected PasswordTextView mPasswordEntry;
private View mOkButton;
- private View mDeleteButton;
- private View[] mButtons = new View[10];
+ private ImageButton mDeleteButton;
+ private NumPadKey[] mButtons = new NumPadKey[10];
+ private View mDivider;
public KeyguardPinBasedInputView(Context context) {
this(context, null);
@@ -147,6 +152,7 @@ public abstract class KeyguardPinBasedInputView extends KeyguardAbsKeyInputView
mDeleteButton = findViewById(R.id.delete_button);
mDeleteButton.setVisibility(View.VISIBLE);
+ mDivider = findViewById(R.id.divider);
mButtons[0] = findViewById(R.id.key0);
mButtons[1] = findViewById(R.id.key1);
@@ -161,6 +167,26 @@ public abstract class KeyguardPinBasedInputView extends KeyguardAbsKeyInputView
mPasswordEntry.requestFocus();
super.onFinishInflate();
+ reloadColors();
+ }
+
+ /**
+ * Reload colors from resources.
+ **/
+ public void reloadColors() {
+ for (NumPadKey key : mButtons) {
+ key.reloadColors();
+ }
+ mPasswordEntry.reloadColors();
+ int deleteColor = Utils.getColorAttr(getContext(), android.R.attr.textColorSecondary)
+ .getDefaultColor();
+ mDeleteButton.setImageTintList(ColorStateList.valueOf(deleteColor));
+ mDivider.setBackground(getContext().getDrawable(R.drawable.pin_divider));
+
+ ContextThemeWrapper themedContext = new ContextThemeWrapper(mContext,
+ R.style.Widget_TextView_NumPadKey);
+ mDeleteButton.setBackground(themedContext.getDrawable(R.drawable.ripple_drawable_pin));
+ mOkButton.setBackground(themedContext.getDrawable(R.drawable.ripple_drawable_pin));
}
@Override
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPinViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPinViewController.java
index 6769436be8ef..fb0d6beca513 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardPinViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPinViewController.java
@@ -53,6 +53,12 @@ public class KeyguardPinViewController
}
@Override
+ public void reloadColors() {
+ super.reloadColors();
+ mView.reloadColors();
+ }
+
+ @Override
void resetState() {
super.resetState();
mMessageAreaController.setMessage("");
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java
index 9a511502b475..1a8d420fb394 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java
@@ -47,6 +47,7 @@ import com.android.keyguard.KeyguardSecurityModel.SecurityMode;
import com.android.keyguard.dagger.KeyguardBouncerScope;
import com.android.settingslib.utils.ThreadUtils;
import com.android.systemui.shared.system.SysUiStatsLog;
+import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.statusbar.policy.KeyguardStateController;
import com.android.systemui.util.ViewController;
@@ -69,6 +70,7 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
private final KeyguardStateController mKeyguardStateController;
private final KeyguardSecurityViewFlipperController mSecurityViewFlipperController;
private final SecurityCallback mSecurityCallback;
+ private final ConfigurationController mConfigurationController;
private SecurityMode mCurrentSecurityMode = SecurityMode.Invalid;
@@ -144,6 +146,18 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
}
}
};
+ private ConfigurationController.ConfigurationListener mConfigurationListener =
+ new ConfigurationController.ConfigurationListener() {
+ @Override
+ public void onOverlayChanged() {
+ mSecurityViewFlipperController.reloadColors();
+ }
+
+ @Override
+ public void onUiModeChanged() {
+ mSecurityViewFlipperController.reloadColors();
+ }
+ };
private KeyguardSecurityContainerController(KeyguardSecurityContainer view,
AdminSecondaryLockScreenController.Factory adminSecondaryLockScreenControllerFactory,
@@ -154,7 +168,8 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
UiEventLogger uiEventLogger,
KeyguardStateController keyguardStateController,
SecurityCallback securityCallback,
- KeyguardSecurityViewFlipperController securityViewFlipperController) {
+ KeyguardSecurityViewFlipperController securityViewFlipperController,
+ ConfigurationController configurationController) {
super(view);
mLockPatternUtils = lockPatternUtils;
mUpdateMonitor = keyguardUpdateMonitor;
@@ -166,6 +181,7 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
mSecurityViewFlipperController = securityViewFlipperController;
mAdminSecondaryLockScreenController = adminSecondaryLockScreenControllerFactory.create(
mKeyguardSecurityCallback);
+ mConfigurationController = configurationController;
}
@Override
@@ -176,10 +192,12 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
@Override
protected void onViewAttached() {
mView.setSwipeListener(mSwipeListener);
+ mConfigurationController.addCallback(mConfigurationListener);
}
@Override
protected void onViewDetached() {
+ mConfigurationController.removeCallback(mConfigurationListener);
}
/** */
@@ -459,6 +477,7 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
private final UiEventLogger mUiEventLogger;
private final KeyguardStateController mKeyguardStateController;
private final KeyguardSecurityViewFlipperController mSecurityViewFlipperController;
+ private final ConfigurationController mConfigurationController;
@Inject
Factory(KeyguardSecurityContainer view,
@@ -470,7 +489,8 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
MetricsLogger metricsLogger,
UiEventLogger uiEventLogger,
KeyguardStateController keyguardStateController,
- KeyguardSecurityViewFlipperController securityViewFlipperController) {
+ KeyguardSecurityViewFlipperController securityViewFlipperController,
+ ConfigurationController configurationController) {
mView = view;
mAdminSecondaryLockScreenControllerFactory = adminSecondaryLockScreenControllerFactory;
mLockPatternUtils = lockPatternUtils;
@@ -480,6 +500,7 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
mUiEventLogger = uiEventLogger;
mKeyguardStateController = keyguardStateController;
mSecurityViewFlipperController = securityViewFlipperController;
+ mConfigurationController = configurationController;
}
public KeyguardSecurityContainerController create(
@@ -487,7 +508,8 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
return new KeyguardSecurityContainerController(mView,
mAdminSecondaryLockScreenControllerFactory, mLockPatternUtils,
mKeyguardUpdateMonitor, mKeyguardSecurityModel, mMetricsLogger, mUiEventLogger,
- mKeyguardStateController, securityCallback, mSecurityViewFlipperController);
+ mKeyguardStateController, securityCallback, mSecurityViewFlipperController,
+ mConfigurationController);
}
}
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityViewFlipperController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityViewFlipperController.java
index 49530355a6fb..f1b504e9f941 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityViewFlipperController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityViewFlipperController.java
@@ -71,6 +71,15 @@ public class KeyguardSecurityViewFlipperController
}
}
+ /**
+ * Reload colors of ui elements upon theme change.
+ */
+ public void reloadColors() {
+ for (KeyguardInputViewController<KeyguardInputView> child : mChildren) {
+ child.reloadColors();
+ }
+ }
+
@VisibleForTesting
KeyguardInputViewController<KeyguardInputView> getSecurityView(SecurityMode securityMode,
KeyguardSecurityCallback keyguardSecurityCallback) {
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinViewController.java
index 2cdd7f117594..5b4a7ff3e16e 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinViewController.java
@@ -309,7 +309,7 @@ public class KeyguardSimPinViewController
Resources rez = mView.getResources();
String msg;
TypedArray array = mView.getContext().obtainStyledAttributes(
- new int[] { R.attr.wallpaperTextColor });
+ new int[] { android.R.attr.textColor });
int color = array.getColor(0, Color.WHITE);
array.recycle();
if (count < 2) {
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSimPukViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSimPukViewController.java
index adb4c13b74d5..eafb33f8195d 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSimPukViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSimPukViewController.java
@@ -189,7 +189,7 @@ public class KeyguardSimPukViewController
Resources rez = mView.getResources();
String msg;
TypedArray array = mView.getContext().obtainStyledAttributes(
- new int[] { R.attr.wallpaperTextColor });
+ new int[] { android.R.attr.textColor });
int color = array.getColor(0, Color.WHITE);
array.recycle();
if (count < 2) {
diff --git a/packages/SystemUI/src/com/android/keyguard/NumPadKey.java b/packages/SystemUI/src/com/android/keyguard/NumPadKey.java
index 2205fdd4267d..a5182055e14d 100644
--- a/packages/SystemUI/src/com/android/keyguard/NumPadKey.java
+++ b/packages/SystemUI/src/com/android/keyguard/NumPadKey.java
@@ -18,9 +18,11 @@ package com.android.keyguard;
import android.content.Context;
import android.content.res.TypedArray;
+import android.graphics.drawable.Drawable;
import android.os.PowerManager;
import android.os.SystemClock;
import android.util.AttributeSet;
+import android.view.ContextThemeWrapper;
import android.view.HapticFeedbackConstants;
import android.view.LayoutInflater;
import android.view.MotionEvent;
@@ -30,6 +32,7 @@ import android.view.accessibility.AccessibilityManager;
import android.widget.TextView;
import com.android.internal.widget.LockPatternUtils;
+import com.android.settingslib.Utils;
import com.android.systemui.R;
public class NumPadKey extends ViewGroup {
@@ -121,12 +124,29 @@ public class NumPadKey extends ViewGroup {
a = context.obtainStyledAttributes(attrs, android.R.styleable.View);
if (!a.hasValueOrEmpty(android.R.styleable.View_background)) {
- setBackground(mContext.getDrawable(R.drawable.ripple_drawable_pin));
+ Drawable rippleDrawable = new ContextThemeWrapper(mContext,
+ R.style.Widget_TextView_NumPadKey).getDrawable(R.drawable.ripple_drawable_pin);
+ setBackground(rippleDrawable);
}
a.recycle();
setContentDescription(mDigitText.getText().toString());
}
+ /**
+ * Reload colors from resources.
+ **/
+ public void reloadColors() {
+ int textColor = Utils.getColorAttr(getContext(), android.R.attr.textColorPrimary)
+ .getDefaultColor();
+ int klondikeColor = Utils.getColorAttr(getContext(), android.R.attr.textColorSecondary)
+ .getDefaultColor();
+ mDigitText.setTextColor(textColor);
+ mKlondikeText.setTextColor(klondikeColor);
+ Drawable rippleDrawable = new ContextThemeWrapper(mContext,
+ R.style.Widget_TextView_NumPadKey).getDrawable(R.drawable.ripple_drawable_pin);
+ setBackground(rippleDrawable);
+ }
+
@Override
public boolean onTouchEvent(MotionEvent event) {
if (event.getActionMasked() == MotionEvent.ACTION_DOWN) {
diff --git a/packages/SystemUI/src/com/android/keyguard/PasswordTextView.java b/packages/SystemUI/src/com/android/keyguard/PasswordTextView.java
index c92174a0d8af..5ffc2836b9e3 100644
--- a/packages/SystemUI/src/com/android/keyguard/PasswordTextView.java
+++ b/packages/SystemUI/src/com/android/keyguard/PasswordTextView.java
@@ -42,6 +42,7 @@ import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;
import android.widget.EditText;
+import com.android.settingslib.Utils;
import com.android.systemui.R;
import java.util.ArrayList;
@@ -131,8 +132,8 @@ public class PasswordTextView extends View {
mCharPadding = a.getDimensionPixelSize(R.styleable.PasswordTextView_charPadding,
getContext().getResources().getDimensionPixelSize(
R.dimen.password_char_padding));
- int textColor = a.getColor(R.styleable.PasswordTextView_android_textColor, Color.WHITE);
- mDrawPaint.setColor(textColor);
+ mDrawPaint.setColor(a.getColor(R.styleable.PasswordTextView_android_textColor,
+ Color.WHITE));
} finally {
a.recycle();
}
@@ -184,6 +185,15 @@ public class PasswordTextView extends View {
}
}
+ /**
+ * Reload colors from resources.
+ **/
+ public void reloadColors() {
+ int textColor = Utils.getColorAttr(getContext(), android.R.attr.textColorPrimary)
+ .getDefaultColor();
+ mDrawPaint.setColor(textColor);
+ }
+
@Override
public boolean hasOverlappingRendering() {
return false;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/MediaNotificationProcessor.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/MediaNotificationProcessor.java
index db5458664023..2586e9403e01 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/MediaNotificationProcessor.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/MediaNotificationProcessor.java
@@ -29,7 +29,7 @@ import androidx.annotation.VisibleForTesting;
import androidx.palette.graphics.Palette;
import com.android.internal.util.ContrastColorUtil;
-import com.android.systemui.R;
+import com.android.settingslib.Utils;
import java.util.List;
@@ -143,7 +143,8 @@ public class MediaNotificationProcessor {
int foregroundColor = selectForegroundColor(backgroundColor, palette);
builder.setColorPalette(backgroundColor, foregroundColor);
} else {
- backgroundColor = mContext.getColor(R.color.notification_material_background_color);
+ backgroundColor = Utils.getColorAttr(mContext, android.R.attr.colorBackground)
+ .getDefaultColor();
}
Bitmap colorized = mColorizer.colorize(drawable, backgroundColor,
mContext.getResources().getConfiguration().getLayoutDirection() ==
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationView.java
index 10273cbbebad..86ebc6b2c4ce 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationView.java
@@ -34,6 +34,7 @@ import android.view.animation.Interpolator;
import android.view.animation.PathInterpolator;
import com.android.internal.jank.InteractionJankMonitor;
+import com.android.settingslib.Utils;
import com.android.systemui.Gefingerpoken;
import com.android.systemui.Interpolators;
import com.android.systemui.R;
@@ -169,13 +170,14 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
}
private void updateColors() {
- mNormalColor = mContext.getColor(R.color.notification_material_background_color);
+ mNormalColor = Utils.getColorAttr(mContext, android.R.attr.colorBackground)
+ .getDefaultColor();
mTintedRippleColor = mContext.getColor(
R.color.notification_ripple_tinted_color);
mNormalRippleColor = mContext.getColor(
R.color.notification_ripple_untinted_color);
mDimmedAlpha = Color.alpha(mContext.getColor(
- R.color.notification_material_background_dimmed_color));
+ R.color.notification_background_dimmed_color));
}
private void initDimens() {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGuts.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGuts.java
index 7071b73c2ebf..8ac5b933e4f9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGuts.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGuts.java
@@ -19,7 +19,6 @@ package com.android.systemui.statusbar.notification.row;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.content.Context;
-import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
@@ -35,7 +34,6 @@ import android.widget.FrameLayout;
import androidx.annotation.Nullable;
import com.android.internal.annotations.VisibleForTesting;
-import com.android.systemui.Dependency;
import com.android.systemui.Interpolators;
import com.android.systemui.R;
import com.android.systemui.statusbar.notification.stack.StackStateAnimator;
@@ -168,9 +166,6 @@ public class NotificationGuts extends FrameLayout {
}
}
};
- final TypedArray ta = context.obtainStyledAttributes(attrs,
- com.android.internal.R.styleable.Theme, 0, 0);
- ta.recycle();
}
public NotificationGuts(Context context) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationViewWrapper.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationViewWrapper.java
index 6920e3f4a7c6..416c5af93400 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationViewWrapper.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationViewWrapper.java
@@ -38,6 +38,7 @@ import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.graphics.ColorUtils;
import com.android.internal.util.ContrastColorUtil;
import com.android.internal.widget.CachingIconView;
+import com.android.settingslib.Utils;
import com.android.systemui.statusbar.CrossFadeHelper;
import com.android.systemui.statusbar.TransformableView;
import com.android.systemui.statusbar.notification.TransformState;
@@ -324,8 +325,8 @@ public abstract class NotificationViewWrapper implements TransformableView {
if (customBackgroundColor != 0) {
return customBackgroundColor;
}
- return mView.getContext().getColor(
- com.android.internal.R.color.notification_material_background_color);
+ return Utils.getColorAttr(mView.getContext(), android.R.attr.colorBackground)
+ .getDefaultColor();
}
public void setLegacy(boolean legacy) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
index ba5f95e9c4d8..5cc17a08504f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
@@ -50,7 +50,6 @@ import android.util.DisplayMetrics;
import android.util.Log;
import android.util.MathUtils;
import android.util.Pair;
-import android.view.ContextThemeWrapper;
import android.view.DisplayCutout;
import android.view.InputDevice;
import android.view.LayoutInflater;
@@ -385,7 +384,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
*/
private float mBackgroundXFactor = 1f;
- private boolean mUsingLightTheme;
private boolean mQsExpanded;
private boolean mForwardScrollable;
private boolean mBackwardScrollable;
@@ -4122,15 +4120,9 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
* @param lightTheme True if light theme should be used.
*/
@ShadeViewRefactor(RefactorComponent.DECORATOR)
- void updateDecorViews(boolean lightTheme) {
- if (lightTheme == mUsingLightTheme) {
- return;
- }
- mUsingLightTheme = lightTheme;
- Context context = new ContextThemeWrapper(mContext,
- lightTheme ? R.style.Theme_SystemUI_Light : R.style.Theme_SystemUI);
+ void updateDecorViews() {
final @ColorInt int textColor =
- Utils.getColorAttrDefaultColor(context, R.attr.wallpaperTextColor);
+ Utils.getColorAttrDefaultColor(mContext, android.R.attr.textColorPrimary);
mSectionsManager.setHeaderForegroundColor(textColor);
mFooterView.setTextColor(textColor);
mEmptyShadeView.setTextColor(textColor);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java
index abbbbb8352f5..8a0330912502 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java
@@ -162,7 +162,6 @@ public class NotificationStackScrollLayoutController {
private final KeyguardMediaController mKeyguardMediaController;
private final SysuiStatusBarStateController mStatusBarStateController;
private final KeyguardBypassController mKeyguardBypassController;
- private final SysuiColorExtractor mColorExtractor;
private final NotificationLockscreenUserManager mLockscreenUserManager;
// TODO: StatusBar should be encapsulated behind a Controller
private final StatusBar mStatusBar;
@@ -224,12 +223,14 @@ public class NotificationStackScrollLayoutController {
public void onOverlayChanged() {
updateShowEmptyShadeView();
mView.updateCornerRadius();
+ mView.updateBgColor();
mView.reinflateViews();
}
@Override
public void onUiModeChanged() {
mView.updateBgColor();
+ mView.updateDecorViews();
}
@Override
@@ -577,7 +578,6 @@ public class NotificationStackScrollLayoutController {
mKeyguardMediaController = keyguardMediaController;
mKeyguardBypassController = keyguardBypassController;
mZenModeController = zenModeController;
- mColorExtractor = colorExtractor;
mLockscreenUserManager = lockscreenUserManager;
mMetricsLogger = metricsLogger;
mFalsingCollector = falsingCollector;
@@ -689,12 +689,6 @@ public class NotificationStackScrollLayoutController {
Settings.Secure.NOTIFICATION_DISMISS_RTL,
Settings.Secure.NOTIFICATION_HISTORY_ENABLED);
- mOnColorsChangedListener = (colorExtractor, which) -> {
- final boolean useDarkText = mColorExtractor.getNeutralColors().supportsDarkText();
- mView.updateDecorViews(useDarkText);
- };
- mColorExtractor.addOnColorsChangedListener(mOnColorsChangedListener);
-
mKeyguardMediaController.setVisibilityChangedListener(visible -> {
mView.setKeyguardMediaControllorVisible(visible);
if (visible) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java
index 54fb863b5de7..0df3347b8f89 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java
@@ -49,7 +49,7 @@ public class LockIcon extends KeyguardAffordanceView {
static final int STATE_SCANNING_FACE = 2;
static final int STATE_BIOMETRICS_ERROR = 3;
private float mDozeAmount;
- private int mIconColor;
+ private int mIconColor = Color.TRANSPARENT;
private int mOldState;
private int mState;
private boolean mDozing;
@@ -149,7 +149,10 @@ public class LockIcon extends KeyguardAffordanceView {
updateDarkTint();
}
- void onThemeChange(int iconColor) {
+ void updateColor(int iconColor) {
+ if (mIconColor == iconColor) {
+ return;
+ }
mDrawableCache.clear();
mIconColor = iconColor;
updateDarkTint();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockscreenLockIconController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockscreenLockIconController.java
index 289ff71dcb46..0e7e2fd8173c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockscreenLockIconController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockscreenLockIconController.java
@@ -84,6 +84,7 @@ public class LockscreenLockIconController {
private boolean mDocked;
private boolean mWakeAndUnlockRunning;
private boolean mShowingLaunchAffordance;
+ private boolean mBouncerShowing;
private boolean mBouncerShowingScrimmed;
private boolean mFingerprintUnlock;
private int mStatusBarState = StatusBarState.SHADE;
@@ -142,16 +143,13 @@ public class LockscreenLockIconController {
private int mDensity;
@Override
- public void onThemeChanged() {
- if (mLockIcon == null) {
- return;
- }
+ public void onUiModeChanged() {
+ updateColor();
+ }
- TypedArray typedArray = mLockIcon.getContext().getTheme().obtainStyledAttributes(
- null, new int[]{ R.attr.wallpaperTextColor }, 0, 0);
- int iconColor = typedArray.getColor(0, Color.WHITE);
- typedArray.recycle();
- mLockIcon.onThemeChange(iconColor);
+ @Override
+ public void onOverlayChanged() {
+ updateColor();
}
@Override
@@ -350,6 +348,7 @@ public class LockscreenLockIconController {
*/
public void attach(LockIcon lockIcon) {
mLockIcon = lockIcon;
+ updateColor();
mLockIcon.setOnClickListener(this::handleClick);
mLockIcon.setOnLongClickListener(this::handleLongClick);
@@ -408,11 +407,22 @@ public class LockscreenLockIconController {
}
/** Sets whether the bouncer is showing. */
- public void setBouncerShowingScrimmed(boolean bouncerShowing) {
- mBouncerShowingScrimmed = bouncerShowing;
- if (mKeyguardBypassController.getBypassEnabled()) {
- update();
+ public void setBouncerShowingScrimmed(boolean showing, boolean scrimmed) {
+ mBouncerShowing = showing;
+ mBouncerShowingScrimmed = scrimmed;
+ update();
+ }
+
+ private void updateColor() {
+ if (mLockIcon == null) {
+ return;
}
+
+ TypedArray typedArray = mLockIcon.getContext().getTheme().obtainStyledAttributes(
+ null, new int[]{ android.R.attr.textColorPrimary }, 0, 0);
+ int iconColor = typedArray.getColor(0, Color.WHITE);
+ typedArray.recycle();
+ mLockIcon.updateColor(iconColor);
}
/**
@@ -510,7 +520,10 @@ public class LockscreenLockIconController {
return changed;
}
boolean onAodOrDocked = mStatusBarStateController.isDozing() || mDocked;
- boolean invisible = onAodOrDocked || mWakeAndUnlockRunning || mShowingLaunchAffordance;
+ boolean onKeyguardWithoutBouncer = mStatusBarState == StatusBarState.KEYGUARD
+ && !mBouncerShowing;
+ boolean invisible = onAodOrDocked || mWakeAndUnlockRunning || mShowingLaunchAffordance
+ || onKeyguardWithoutBouncer;
boolean fingerprintOrBypass = mFingerprintUnlock
|| mKeyguardBypassController.getBypassEnabled();
if (fingerprintOrBypass && !mBouncerShowingScrimmed) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
index 4af27877c201..a8338d346bc8 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
@@ -37,22 +37,21 @@ import android.view.animation.Interpolator;
import androidx.annotation.Nullable;
import com.android.internal.annotations.VisibleForTesting;
-import com.android.internal.colorextraction.ColorExtractor;
import com.android.internal.colorextraction.ColorExtractor.GradientColors;
-import com.android.internal.colorextraction.ColorExtractor.OnColorsChangedListener;
import com.android.internal.graphics.ColorUtils;
import com.android.internal.util.function.TriConsumer;
import com.android.keyguard.KeyguardUpdateMonitor;
import com.android.keyguard.KeyguardUpdateMonitorCallback;
+import com.android.settingslib.Utils;
import com.android.systemui.DejankUtils;
import com.android.systemui.Dumpable;
import com.android.systemui.R;
-import com.android.systemui.colorextraction.SysuiColorExtractor;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dock.DockManager;
import com.android.systemui.statusbar.BlurUtils;
import com.android.systemui.statusbar.ScrimView;
import com.android.systemui.statusbar.notification.stack.ViewState;
+import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.statusbar.policy.KeyguardStateController;
import com.android.systemui.util.AlarmTimeout;
import com.android.systemui.util.wakelock.DelayedWakeLock;
@@ -71,8 +70,7 @@ import javax.inject.Inject;
* security method gets shown).
*/
@SysUISingleton
-public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnColorsChangedListener,
- Dumpable {
+public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dumpable {
static final String TAG = "ScrimController";
private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
@@ -125,12 +123,12 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
* The default scrim under the shade and dialogs.
* This should not be lower than 0.54, otherwise we won't pass GAR.
*/
- public static final float BUSY_SCRIM_ALPHA = 0.85f;
+ public static final float BUSY_SCRIM_ALPHA = 1f;
/**
* Same as above, but when blur is supported.
*/
- public static final float BLUR_SCRIM_ALPHA = 0.54f;
+ public static final float BLUR_SCRIM_ALPHA = 0.80f;
static final int TAG_KEY_ANIM = R.id.scrim;
private static final int TAG_START_ALPHA = R.id.scrim_alpha_start;
@@ -153,8 +151,8 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
private final AlarmTimeout mTimeTicker;
private final KeyguardVisibilityCallback mKeyguardVisibilityCallback;
private final Handler mHandler;
+ private final BlurUtils mBlurUtils;
- private final SysuiColorExtractor mColorExtractor;
private GradientColors mColors;
private boolean mNeedsDrawableColorUpdate;
@@ -204,12 +202,13 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
public ScrimController(LightBarController lightBarController, DozeParameters dozeParameters,
AlarmManager alarmManager, KeyguardStateController keyguardStateController,
DelayedWakeLock.Builder delayedWakeLockBuilder, Handler handler,
- KeyguardUpdateMonitor keyguardUpdateMonitor, SysuiColorExtractor sysuiColorExtractor,
- DockManager dockManager, BlurUtils blurUtils) {
+ KeyguardUpdateMonitor keyguardUpdateMonitor, DockManager dockManager,
+ BlurUtils blurUtils, ConfigurationController configurationController) {
mScrimStateListener = lightBarController::setScrimState;
mDefaultScrimAlpha = blurUtils.supportsBlursOnWindows()
? BLUR_SCRIM_ALPHA : BUSY_SCRIM_ALPHA;
+ mBlurUtils = blurUtils;
mKeyguardStateController = keyguardStateController;
mDarkenWhileDragging = !mKeyguardStateController.canDismissLockScreen();
@@ -230,11 +229,19 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
keyguardStateController.getKeyguardFadingAwayDuration());
}
});
+ configurationController.addCallback(new ConfigurationController.ConfigurationListener() {
+ @Override
+ public void onThemeChanged() {
+ ScrimController.this.onThemeChanged();
+ }
- mColorExtractor = sysuiColorExtractor;
- mColorExtractor.addOnColorsChangedListener(this);
- mColors = mColorExtractor.getNeutralColors();
- mNeedsDrawableColorUpdate = true;
+ @Override
+ public void onUiModeChanged() {
+ ScrimController.this.onThemeChanged();
+ }
+ });
+
+ mColors = new GradientColors();
}
/**
@@ -245,6 +252,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
mScrimBehind = scrimBehind;
mScrimInFront = scrimInFront;
mScrimForBubble = scrimForBubble;
+ updateThemeColors();
if (mScrimBehindChangeRunnable != null) {
mScrimBehind.setChangeRunnable(mScrimBehindChangeRunnable);
@@ -619,11 +627,6 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
mScrimInFront.setColors(mColors, animateScrimInFront);
mScrimBehind.setColors(mColors, animateScrimBehind);
- // Calculate minimum scrim opacity for white or black text.
- int textColor = mColors.supportsDarkText() ? Color.BLACK : Color.WHITE;
- int mainColor = mColors.getMainColor();
- float minOpacity = ColorUtils.calculateMinimumBackgroundAlpha(textColor, mainColor,
- 4.5f /* minimumContrast */) / 255f;
dispatchScrimState(mScrimBehind.getViewAlpha());
}
@@ -968,10 +971,19 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
// Don't care in the base class.
}
- @Override
- public void onColorsChanged(ColorExtractor colorExtractor, int which) {
- mColors = mColorExtractor.getNeutralColors();
+ private void updateThemeColors() {
+ int background = Utils.getColorAttr(mScrimBehind.getContext(),
+ android.R.attr.colorBackgroundFloating).getDefaultColor();
+ int accent = Utils.getColorAccent(mScrimBehind.getContext()).getDefaultColor();
+ mColors.setMainColor(background);
+ mColors.setSecondaryColor(accent);
+ mColors.setSupportsDarkText(
+ ColorUtils.calculateContrast(mColors.getMainColor(), Color.WHITE) > 4.5);
mNeedsDrawableColorUpdate = true;
+ }
+
+ private void onThemeChanged() {
+ updateThemeColors();
scheduleUpdate();
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
index c8c5a6331a3b..9e872ab65591 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
@@ -3782,7 +3782,8 @@ public class StatusBar extends SystemUI implements DemoMode,
mBouncerShowing = bouncerShowing;
mKeyguardBypassController.setBouncerShowing(bouncerShowing);
mPulseExpansionHandler.setBouncerShowing(bouncerShowing);
- mLockscreenLockIconController.setBouncerShowingScrimmed(isBouncerShowingScrimmed());
+ mLockscreenLockIconController.setBouncerShowingScrimmed(bouncerShowing,
+ isBouncerShowingScrimmed());
if (mStatusBarView != null) mStatusBarView.setBouncerShowing(bouncerShowing);
updateHideIconsForBouncer(true /* animate */);
mCommandQueue.recomputeDisableFlags(mDisplayId, true /* animate */);
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSecurityContainerControllerTest.java b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSecurityContainerControllerTest.java
index eef38d316775..b03dc94fde33 100644
--- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSecurityContainerControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSecurityContainerControllerTest.java
@@ -34,6 +34,7 @@ import com.android.internal.logging.UiEventLogger;
import com.android.internal.widget.LockPatternUtils;
import com.android.keyguard.KeyguardSecurityModel.SecurityMode;
import com.android.systemui.SysuiTestCase;
+import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.statusbar.policy.KeyguardStateController;
import org.junit.Before;
@@ -80,6 +81,8 @@ public class KeyguardSecurityContainerControllerTest extends SysuiTestCase {
private KeyguardSecurityViewFlipper mSecurityViewFlipper;
@Mock
private KeyguardSecurityViewFlipperController mKeyguardSecurityViewFlipperController;
+ @Mock
+ private ConfigurationController mConfigurationController;
private KeyguardSecurityContainerController mKeyguardSecurityContainerController;
@@ -92,8 +95,8 @@ public class KeyguardSecurityContainerControllerTest extends SysuiTestCase {
mKeyguardSecurityContainerController = new KeyguardSecurityContainerController.Factory(
mView, mAdminSecondaryLockScreenControllerFactory, mLockPatternUtils,
mKeyguardUpdateMonitor, mKeyguardSecurityModel, mMetricsLogger, mUiEventLogger,
- mKeyguardStateController, mKeyguardSecurityViewFlipperController)
- .create(mSecurityCallback);
+ mKeyguardStateController, mKeyguardSecurityViewFlipperController,
+ mConfigurationController).create(mSecurityCallback);
}
@Test
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java
index 23f263746fb3..eaf31ed17bb2 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java
@@ -48,10 +48,10 @@ import com.android.internal.colorextraction.ColorExtractor.GradientColors;
import com.android.keyguard.KeyguardUpdateMonitor;
import com.android.systemui.DejankUtils;
import com.android.systemui.SysuiTestCase;
-import com.android.systemui.colorextraction.SysuiColorExtractor;
import com.android.systemui.dock.DockManager;
import com.android.systemui.statusbar.BlurUtils;
import com.android.systemui.statusbar.ScrimView;
+import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.statusbar.policy.KeyguardStateController;
import com.android.systemui.util.wakelock.DelayedWakeLock;
import com.android.systemui.utils.os.FakeHandler;
@@ -99,11 +99,11 @@ public class ScrimControllerTest extends SysuiTestCase {
@Mock
KeyguardUpdateMonitor mKeyguardUpdateMonitor;
@Mock
- private SysuiColorExtractor mSysuiColorExtractor;
- @Mock
private DockManager mDockManager;
@Mock
private BlurUtils mBlurUtils;
+ @Mock
+ private ConfigurationController mConfigurationController;
private static class AnimatorListener implements Animator.AnimatorListener {
@@ -196,6 +196,7 @@ public class ScrimControllerTest extends SysuiTestCase {
when(mDozeParamenters.getAlwaysOn()).thenAnswer(invocation -> mAlwaysOnEnabled);
when(mDozeParamenters.getDisplayNeedsBlanking()).thenReturn(true);
+ when(mBlurUtils.supportsBlursOnWindows()).thenReturn(true);
doAnswer((Answer<Void>) invocation -> {
mScrimState = invocation.getArgument(0);
@@ -211,14 +212,12 @@ public class ScrimControllerTest extends SysuiTestCase {
.thenReturn(mDelayedWakeLockBuilder);
when(mDelayedWakeLockBuilder.build()).thenReturn(mWakeLock);
- when(mSysuiColorExtractor.getNeutralColors()).thenReturn(new GradientColors());
-
when(mDockManager.isDocked()).thenReturn(false);
mScrimController = new ScrimController(mLightBarController,
mDozeParamenters, mAlarmManager, mKeyguardStateController, mDelayedWakeLockBuilder,
- new FakeHandler(mLooper.getLooper()), mKeyguardUpdateMonitor, mSysuiColorExtractor,
- mDockManager, mBlurUtils);
+ new FakeHandler(mLooper.getLooper()), mKeyguardUpdateMonitor,
+ mDockManager, mBlurUtils, mConfigurationController);
mScrimController.setScrimVisibleListener(visible -> mScrimVisibility = visible);
mScrimController.attachViews(mScrimBehind, mScrimInFront, mScrimForBubble);
mScrimController.setAnimatorListener(mAnimatorListener);
@@ -520,10 +519,10 @@ public class ScrimControllerTest extends SysuiTestCase {
Assert.assertEquals(ScrimController.TRANSPARENT,
mScrimInFront.getViewAlpha(), 0.0f);
// Back scrim should be visible
- Assert.assertEquals(ScrimController.BUSY_SCRIM_ALPHA,
+ Assert.assertEquals(ScrimController.BLUR_SCRIM_ALPHA,
mScrimBehind.getViewAlpha(), 0.0f);
// Bubble scrim should be visible
- Assert.assertEquals(ScrimController.BUSY_SCRIM_ALPHA,
+ Assert.assertEquals(ScrimController.BLUR_SCRIM_ALPHA,
mScrimBehind.getViewAlpha(), 0.0f);
}
diff --git a/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java b/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
index 77090a8e0d83..e2c5e97b8896 100644
--- a/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
+++ b/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
@@ -4252,10 +4252,7 @@ public class DevicePolicyManagerTest extends DpmTestBase {
mContext.packageName = admin1.getPackageName();
mContext.applicationInfo = new ApplicationInfo();
- when(mContext.resources.getColor(eq(R.color.notification_action_list), anyObject()))
- .thenReturn(Color.WHITE);
- when(mContext.resources.getColor(eq(R.color.notification_material_background_color),
- anyObject())).thenReturn(Color.WHITE);
+ when(mContext.resources.getColor(anyInt(), anyObject())).thenReturn(Color.WHITE);
// setUp() adds a secondary user for CALLER_USER_HANDLE. Remove it as otherwise the
// feature is disabled because there are non-affiliated secondary users.
@@ -4301,10 +4298,7 @@ public class DevicePolicyManagerTest extends DpmTestBase {
setupDeviceOwner();
mContext.packageName = admin1.getPackageName();
mContext.applicationInfo = new ApplicationInfo();
- when(mContext.resources.getColor(eq(R.color.notification_action_list), anyObject()))
- .thenReturn(Color.WHITE);
- when(mContext.resources.getColor(eq(R.color.notification_material_background_color),
- anyObject())).thenReturn(Color.WHITE);
+ when(mContext.resources.getColor(anyInt(), anyObject())).thenReturn(Color.WHITE);
// setUp() adds a secondary user for CALLER_USER_HANDLE. Remove it as otherwise the
// feature is disabled because there are non-affiliated secondary users.