Changes for June 2022, syncing up to v414

This commit is contained in:
Andy CrossGate Yan
2022-06-14 08:34:07 +08:00
parent 969f476c22
commit c40dad91ee
72 changed files with 314 additions and 825 deletions

View File

@@ -1,7 +1,7 @@
From 3092553e69dcf3976fe329939cc56fb2e9e2a4cc Mon Sep 17 00:00:00 2001
From 853ee250c636882896bcfeb94c61317145222ff6 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Thu, 13 Jan 2022 14:22:24 +0000
Subject: [PATCH 01/19] Add SPenPointerOverlay
Subject: [PATCH 01/12] Add SPenPointerOverlay
Toggle this overlay with property "persist.ui.spen.pointer"

View File

@@ -1,7 +1,7 @@
From 6b598113408b5e7f8fc425efd86779e96c0d7e69 Mon Sep 17 00:00:00 2001
From 26fe8ee33de29f64dcf245bc1e86733140d89809 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Thu, 5 Apr 2018 10:01:19 +0800
Subject: [PATCH 02/19] Disable vendor mismatch warning
Subject: [PATCH 02/12] Disable vendor mismatch warning
Change-Id: Ieb8fe91e2f02462f074312ed0f4885d183e9780b
---
@@ -9,7 +9,7 @@ Change-Id: Ieb8fe91e2f02462f074312ed0f4885d183e9780b
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
index 112a56957fc0..8b6ec8bbf3ff 100644
index 68df0e433c1d..89d1a7ba3317 100644
--- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
+++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
@@ -5665,20 +5665,8 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {

View File

@@ -1,7 +1,7 @@
From ba083752bf0310ee14884e4a2fe3e3e5846c62b5 Mon Sep 17 00:00:00 2001
From fc56cacb75ec154140784fe4115c610d2db9d2bc Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sat, 16 Oct 2021 02:23:48 +0000
Subject: [PATCH 03/19] UI: Adjust default navbar layouts
Subject: [PATCH 03/12] UI: Adjust default navbar layouts
- Slightly tighten nodpi layout
- Remove sw372dp layout - looks terrible, probably meant for legacy phablets, but most modern phones qualify
@@ -45,7 +45,7 @@ index 07b797a32428..000000000000
- <string name="config_navBarLayout" translatable="false">left[.25W],back[.5WC];home;recent[.5WC],right[.25W]</string>
-</resources>
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index 6ccabf226772..909e7e7f46b3 100644
index 53523e3f4f5a..94cc561f5fb0 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -332,7 +332,7 @@

View File

@@ -1,7 +1,7 @@
From d461abc9968ac7937e5530efd15d46671565c316 Mon Sep 17 00:00:00 2001
From 7c54f36cc9e53c9b4781d7233fb0b0f389c12ecc Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Fri, 9 Mar 2018 15:41:26 +0800
Subject: [PATCH 04/19] UI: Disable left (seascape) navigation bar optionally
Subject: [PATCH 04/12] UI: Disable left (seascape) navigation bar optionally
Toggle this behaviour with property "persist.ui.seascape.disable"
@@ -45,10 +45,10 @@ index f1e1366404a2..f43bef8532b8 100644
for (int i = 0; i < group.getChildCount(); i++) {
final View child = group.getChildAt(i);
diff --git a/services/core/java/com/android/server/wm/DisplayPolicy.java b/services/core/java/com/android/server/wm/DisplayPolicy.java
index 65eaa63118b2..89ac6585c673 100644
index 0a5d7f41f40f..969d70099cfb 100644
--- a/services/core/java/com/android/server/wm/DisplayPolicy.java
+++ b/services/core/java/com/android/server/wm/DisplayPolicy.java
@@ -2644,9 +2644,10 @@ public class DisplayPolicy {
@@ -2694,9 +2694,10 @@ public class DisplayPolicy {
}
}
if (navigationBarCanMove() && displayWidth > displayHeight) {

View File

@@ -1,7 +1,7 @@
From a996ded413ad03db5074c8cf32858e478d196fc7 Mon Sep 17 00:00:00 2001
From a5daefa52e5bee3d961c2db3a288387736d58269 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 10 Jan 2021 11:44:29 +0000
Subject: [PATCH 05/19] UI: Disable wallpaper zoom
Subject: [PATCH 05/12] UI: Disable wallpaper zoom
It does little more than inducing motion sickness
@@ -11,10 +11,10 @@ Change-Id: I78cc5484930b27f172cd8d8a5bd9042dce3478d0
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index e2216d23e15e..9d6c712c8285 100644
index e502765617af..92026da0981e 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -4842,7 +4842,7 @@
@@ -4844,7 +4844,7 @@
<string name="config_customMediaSessionPolicyProvider"></string>
<!-- The max scale for the wallpaper when it's zoomed in -->

View File

@@ -1,26 +1,35 @@
From 972bc4938064c391290503d7fbeb200e339fe326 Mon Sep 17 00:00:00 2001
From f67b7f525bf11860fcb6e08a4450937040b786cd Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Wed, 3 Jun 2020 01:31:34 +0000
Subject: [PATCH 06/19] UI: Increase default status bar height
Subject: [PATCH 06/12] UI: Increase default status bar height
Change-Id: Ibbcf63159e19bb2bb2b1094ea07ab85917630b07
---
core/res/res/values/dimens.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
core/res/res/values/dimens.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml
index f331f1ab720f..a31e166296ee 100644
index cafebcec454e..11515b57dff1 100644
--- a/core/res/res/values/dimens.xml
+++ b/core/res/res/values/dimens.xml
@@ -42,7 +42,7 @@
@@ -41,7 +41,7 @@
<!-- The default height of the status bar used in {@link SystemBarUtils#getStatusBarHeight} to
calculate the status bar height. -->
- <dimen name="status_bar_height_default">24dp</dimen>
+ <dimen name="status_bar_height_default">28dp</dimen>
<!-- Height of the status bar.
Do not read this dimen directly. Use {@link SystemBarUtils#getStatusBarHeight} instead.
-->
- <dimen name="status_bar_height">24dp</dimen>
+ <dimen name="status_bar_height">28dp</dimen>
@@ -49,7 +49,7 @@
<!-- Height of the status bar in portrait.
Do not read this dimen directly. Use {@link SystemBarUtils#getStatusBarHeight} instead.
-->
- <dimen name="status_bar_height_portrait">24dp</dimen>
+ <dimen name="status_bar_height_portrait">28dp</dimen>
<!-- Height of the status bar in landscape.
Do not read this dimen directly. Use {@link SystemBarUtils#getStatusBarHeight} instead.
-->
--
2.25.1

View File

@@ -1,7 +1,7 @@
From e31ba474b5b86eefe07fdd630c761fc035a0e05f Mon Sep 17 00:00:00 2001
From e4cc0b28ec7a8ac5addecd370b2af6de0617abec Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sat, 19 Mar 2022 09:22:24 +0000
Subject: [PATCH 07/19] UI: Restore split-screen divider to pre-Sv2 looks
Subject: [PATCH 07/12] UI: Restore split-screen divider to pre-Sv2 looks
- Kill rounded corners - where two rectangles collide should be perfectly straight
- Make it black again - taskbar should mind its own business

View File

@@ -1,7 +1,7 @@
From bb47f4b8d64a57c3eb5dae7a13c3abdac8533736 Mon Sep 17 00:00:00 2001
From 179273341668efc421afb80fdf4356f1034adff4 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Tue, 6 Oct 2020 01:41:16 +0000
Subject: [PATCH 08/19] UI: Revive navbar layout tuning via sysui_nav_bar
Subject: [PATCH 08/12] UI: Revive navbar layout tuning via sysui_nav_bar
tunable
Google keeps fixing what ain't broken.
@@ -12,7 +12,7 @@ Change-Id: Ied7d7859e50fd0fcc346219964e747c5d5f4c352
1 file changed, 15 insertions(+)
diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarInflaterView.java b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarInflaterView.java
index c8bc143f0bd8..fab079b91608 100644
index eb9544c1372b..8cc9a32a1794 100644
--- a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarInflaterView.java
+++ b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarInflaterView.java
@@ -118,6 +118,7 @@ public class NavigationBarInflaterView extends FrameLayout

View File

@@ -1,7 +1,7 @@
From 30cb3ac5413b13486cf8a4035aaf58f302f6c922 Mon Sep 17 00:00:00 2001
From f712cf528b67e2c2b2a13dd84de8a288a9e216d9 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 26 Apr 2020 08:56:13 +0000
Subject: [PATCH 09/19] UI: Use SNAP_FIXED_RATIO for multi-window globally
Subject: [PATCH 09/12] UI: Use SNAP_FIXED_RATIO for multi-window globally
Enables multiple snap targets under landscape for phone UI
@@ -78,7 +78,7 @@ index 624581aba7dd..658654e2a63f 100644
Only applies if the device display is not square. -->
<bool name="config_navBarCanMove">false</bool>
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 9d6c712c8285..1b9306913e7d 100644
index 92026da0981e..e4e7243bbb76 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -3589,7 +3589,7 @@

View File

@@ -1,7 +1,7 @@
From 7a1136397113e10afc36276f70f62083c20abe95 Mon Sep 17 00:00:00 2001
From 075046ebdb3172a09ecefdda5c8a15206ae9eaa8 Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Tue, 3 Nov 2020 22:43:12 -0800
Subject: [PATCH 10/19] core: Remove old app target SDK dialog
Subject: [PATCH 10/12] core: Remove old app target SDK dialog
If an app is old, users should already know that, and there's usually no
point in warning them about it because they would already be using a

View File

@@ -1,7 +1,7 @@
From 757fc3ae84413ca0b158c1a4f5fa6b18d517beab Mon Sep 17 00:00:00 2001
From 3947b3df5f72e803dae08f2fe6725535e6da1d45 Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Tue, 5 Oct 2021 21:01:50 -0700
Subject: [PATCH 18/19] Paint: Enable subpixel text positioning by default
Subject: [PATCH 11/12] Paint: Enable subpixel text positioning by default
On desktop Linux, subpixel text positioning is necessary to avoid
kerning issues, and Android is no different. Even though most phone

View File

@@ -1,41 +0,0 @@
From 00f4d1dfbf1e280000872545d873fef7fec30ba0 Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Tue, 8 Mar 2022 20:37:33 -0800
Subject: [PATCH 11/19] SystemUI: Always refresh power menu on UI mode change
This is necessary for reliably theming the global actions dialog with
dynamic colors and adapting it to light/dark themes.
Demo screenshots (with color overlays applied):
https://twitter.com/kdrag0n/status/1445960685427433473
[kdrag0n: ported to 12L]
Change-Id: If58fb4079a4cd11414ff928fad3576beecb14ff5
---
.../systemui/globalactions/GlobalActionsDialogLite.java | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java
index bddf5756f925..0ed1042f21e2 100644
--- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java
+++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java
@@ -787,6 +787,15 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene
&& (currentUser == null || currentUser.isPrimary());
}
+ @Override
+ public void onUiModeChanged() {
+ // Colors may change, depending on UI mode
+ mContext.getTheme().applyStyle(mContext.getThemeResId(), true);
+ if (mDialog != null) {
+ mDialog.refreshDialog();
+ }
+ }
+
@Override
public void onConfigChanged(Configuration newConfig) {
if (mDialog != null && mDialog.isShowing()
--
2.25.1

View File

@@ -1,7 +1,7 @@
From 80a2541826f9faa2f58c135dcbafb81f1399dcfb Mon Sep 17 00:00:00 2001
From f7ba774141c921d1c44a4d83d3c0dd40fc67061f Mon Sep 17 00:00:00 2001
From: SagarMakhar <sagarmakhar@gmail.com>
Date: Sat, 6 Nov 2021 13:16:24 +0000
Subject: [PATCH 19/19] Fix QS clock being white on light theme
Subject: [PATCH 12/12] Fix QS clock being white on light theme
Steps to reproduce without this commit:
- Turn off dark theme

View File

@@ -1,55 +0,0 @@
From b708cbead42948667b098a818432c073169c6ffa Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Sat, 9 Oct 2021 14:39:38 -0700
Subject: [PATCH 12/19] SystemUI: Use Monet colors for power menu
It's odd that the power menu doesn't use Monet colors, unlike most of
System UI. This makes it feel more integrated with the rest of the
system.
Change-Id: Iaffb178fe2c09a33925cb40e89d78640fab2b23c
---
packages/SystemUI/res/values-night/colors.xml | 7 +++++++
packages/SystemUI/res/values/colors.xml | 10 +++++-----
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/packages/SystemUI/res/values-night/colors.xml b/packages/SystemUI/res/values-night/colors.xml
index fcb369876cf2..a0015a72f268 100644
--- a/packages/SystemUI/res/values-night/colors.xml
+++ b/packages/SystemUI/res/values-night/colors.xml
@@ -99,4 +99,11 @@
<color name="accessibility_floating_menu_background">#B3000000</color> <!-- 70% -->
<color name="people_tile_background">@android:color/system_accent2_800</color>
+
+ <!-- Colors for Power Menu Lite -->
+ <color name="global_actions_lite_background">@*android:color/primary_device_default_dark</color>
+ <color name="global_actions_lite_button_background">@*android:color/surface_dark</color>
+ <color name="global_actions_lite_text">@*android:color/foreground_device_default_dark</color>
+ <color name="global_actions_lite_emergency_background">@*android:color/surface_dark</color>
+ <color name="global_actions_lite_emergency_icon">@*android:color/accent_device_default_dark</color>
</resources>
diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml
index e455aaa225be..04d4fedccdec 100644
--- a/packages/SystemUI/res/values/colors.xml
+++ b/packages/SystemUI/res/values/colors.xml
@@ -34,11 +34,11 @@
<color name="global_actions_grid_background">#F1F3F4</color>
<!-- Colors for Power Menu Lite -->
- <color name="global_actions_lite_background">#191C18</color>
- <color name="global_actions_lite_button_background">#303030</color>
- <color name="global_actions_lite_text">#F0F0F0</color>
- <color name="global_actions_lite_emergency_background">#F85D4D</color>
- <color name="global_actions_lite_emergency_icon">@color/GM2_grey_900</color>
+ <color name="global_actions_lite_background">@*android:color/primary_device_default_light</color>
+ <color name="global_actions_lite_button_background">@*android:color/surface_light</color>
+ <color name="global_actions_lite_text">@*android:color/foreground_device_default_light</color>
+ <color name="global_actions_lite_emergency_background">@*android:color/surface_light</color>
+ <color name="global_actions_lite_emergency_icon">@*android:color/accent_device_default_light</color>
<color name="global_actions_shutdown_ui_text">@color/control_primary_text</color>
--
2.25.1

View File

@@ -1,54 +0,0 @@
From 485e73406b919813149356a66bb3b92c5a4fd216 Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Wed, 6 Oct 2021 18:40:30 -0700
Subject: [PATCH 13/19] Revert "Make QS always use dark theme colors"
This reverts commit d62f7249f9e3222da95ecf6816601c408aac6be5.
This is a prerequisite for making the QS panel follow the light system
theme setting.
Change-Id: Iac4c96ccb3845812ca3df820bf27dc533816f72e
---
packages/SystemUI/res/layout/quick_qs_status_icons.xml | 2 +-
packages/SystemUI/res/values/styles.xml | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/packages/SystemUI/res/layout/quick_qs_status_icons.xml b/packages/SystemUI/res/layout/quick_qs_status_icons.xml
index 542a1c9d22bd..7a370d8cbc48 100644
--- a/packages/SystemUI/res/layout/quick_qs_status_icons.xml
+++ b/packages/SystemUI/res/layout/quick_qs_status_icons.xml
@@ -24,7 +24,7 @@
android:minHeight="@dimen/qs_header_row_min_height"
android:clickable="false"
android:focusable="true"
- android:theme="@style/Theme.SystemUI.QuickSettings.Header">
+ android:theme="@style/QSHeaderTheme">
<LinearLayout
android:id="@+id/clock_container"
diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml
index f26159f5176a..e2665f879e5e 100644
--- a/packages/SystemUI/res/values/styles.xml
+++ b/packages/SystemUI/res/values/styles.xml
@@ -326,7 +326,7 @@
<item name="*android:dotColor">?android:attr/textColorSecondary</item>
</style>
- <style name="Theme.SystemUI.QuickSettings" parent="@*android:style/Theme.DeviceDefault">
+ <style name="Theme.SystemUI.QuickSettings" parent="@*android:style/Theme.DeviceDefault.SystemUI">
<item name="lightIconTheme">@style/QSIconTheme</item>
<item name="darkIconTheme">@style/QSIconTheme</item>
<item name="android:colorError">@*android:color/error_color_material_dark</item>
@@ -421,7 +421,7 @@
<item name="singleToneColor">@color/dark_mode_qs_icon_color_single_tone</item>
</style>
- <style name="Theme.SystemUI.QuickSettings.Header">
+ <style name="QSHeaderTheme" parent="@style/Theme.SystemUI">
<item name="lightIconTheme">@style/DualToneLightTheme</item>
<item name="darkIconTheme">@style/QSHeaderDarkTheme</item>
</style>
--
2.25.1

View File

@@ -1,33 +0,0 @@
From 3e3f73958f43aa63986cac35a119467ca4cafbd8 Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Wed, 6 Oct 2021 18:41:11 -0700
Subject: [PATCH 14/19] Revert "Do not re-inflate QS and SB when
CONFIG_UI_MODE"
This reverts commit 8a40ff855b86bc86e23367017002289920855a4e.
This is a prerequisite for making the QS panel follow the light system
mode setting.
Change-Id: Ibad399ece587505559cc73febdda2f2d8558e94d
---
.../com/android/systemui/fragments/FragmentHostManager.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/packages/SystemUI/src/com/android/systemui/fragments/FragmentHostManager.java b/packages/SystemUI/src/com/android/systemui/fragments/FragmentHostManager.java
index 10878dcc2474..483865186945 100644
--- a/packages/SystemUI/src/com/android/systemui/fragments/FragmentHostManager.java
+++ b/packages/SystemUI/src/com/android/systemui/fragments/FragmentHostManager.java
@@ -53,7 +53,8 @@ public class FragmentHostManager {
private final View mRootView;
private final InterestingConfigChanges mConfigChanges = new InterestingConfigChanges(
ActivityInfo.CONFIG_FONT_SCALE | ActivityInfo.CONFIG_LOCALE
- | ActivityInfo.CONFIG_SCREEN_LAYOUT | ActivityInfo.CONFIG_ASSETS_PATHS);
+ | ActivityInfo.CONFIG_SCREEN_LAYOUT | ActivityInfo.CONFIG_ASSETS_PATHS
+ | ActivityInfo.CONFIG_UI_MODE);
private final FragmentService mManager;
private final ExtensionFragmentManager mPlugins = new ExtensionFragmentManager();
--
2.25.1

View File

@@ -1,294 +0,0 @@
From 11dd90792ba2293e623a686cea1f4a61ed292993 Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Mon, 11 Oct 2021 19:24:58 -0700
Subject: [PATCH 15/19] SystemUI: Follow light/dark theme in quick settings
Android 12's dual-tone style where the quick settings panel is always
dark makes the light theme look like a second-class citizen. Pure black
also looks out-of-place next to QS tiles and the notification panel
because dynamic themes don't affect it at all.
Revert to the ~Beta 1 style where quick settings used the same theme as
the notification shade.
- colorAccentPrimary has been replaced with colorAccent for contrast in
light mode, because colorAccentPrimary is system_accent1_100 (dark
accent color)
- Footer chips have been converted to surfaces (similar to QS tiles and
notifications), which makes more sense with the new style
- The QS background is now the same as the notification shade background
in both light and dark modes
Demo screenshots (with dual-tone commit):
https://twitter.com/kdrag0n/status/1445922541218922496
[kdrag0n: ported to 12L]
Change-Id: I3d45b72f0f119e100505409d178ab8f698993881
---
.../brightness_progress_full_drawable.xml | 2 +-
.../qs_footer_action_chip_background.xml | 8 +-------
.../qs_security_footer_background.xml | 3 +--
.../res/layout/combined_qs_header.xml | 4 ++--
.../res/layout/split_shade_header.xml | 2 +-
packages/SystemUI/res/values-night/styles.xml | 12 +++++++++++
packages/SystemUI/res/values/styles.xml | 10 +++++-----
.../systemui/privacy/OngoingPrivacyChip.kt | 4 ++--
.../systemui/qs/tileimpl/QSTileViewImpl.kt | 2 +-
.../statusbar/phone/ScrimController.java | 2 +-
.../systemui/statusbar/phone/ScrimState.java | 20 +++++++++----------
11 files changed, 37 insertions(+), 32 deletions(-)
diff --git a/packages/SystemUI/res/drawable/brightness_progress_full_drawable.xml b/packages/SystemUI/res/drawable/brightness_progress_full_drawable.xml
index 4d9188c40822..1eae667c6e79 100644
--- a/packages/SystemUI/res/drawable/brightness_progress_full_drawable.xml
+++ b/packages/SystemUI/res/drawable/brightness_progress_full_drawable.xml
@@ -22,7 +22,7 @@
android:height="@dimen/rounded_slider_height">
<shape>
<size android:height="@dimen/rounded_slider_height" />
- <solid android:color="?priv-android:attr/colorAccentPrimary" />
+ <solid android:color="?android:attr/colorAccent" />
<corners android:radius="@dimen/rounded_slider_corner_radius"/>
</shape>
</item>
diff --git a/packages/SystemUI/res/drawable/qs_footer_action_chip_background.xml b/packages/SystemUI/res/drawable/qs_footer_action_chip_background.xml
index 9076da795e71..3aefc95a98b5 100644
--- a/packages/SystemUI/res/drawable/qs_footer_action_chip_background.xml
+++ b/packages/SystemUI/res/drawable/qs_footer_action_chip_background.xml
@@ -28,13 +28,7 @@
</item>
<item>
<shape android:shape="rectangle">
- <solid android:color="?attr/underSurfaceColor"/>
- <corners android:radius="@dimen/qs_footer_action_corner_radius"/>
- </shape>
- </item>
- <item>
- <shape android:shape="rectangle">
- <stroke android:width="1dp" android:color="?android:attr/colorBackground"/>
+ <solid android:color="?attr/offStateColor"/>
<corners android:radius="@dimen/qs_footer_action_corner_radius"/>
</shape>
</item>
diff --git a/packages/SystemUI/res/drawable/qs_security_footer_background.xml b/packages/SystemUI/res/drawable/qs_security_footer_background.xml
index 860d23b11439..8f12b95ed4f6 100644
--- a/packages/SystemUI/res/drawable/qs_security_footer_background.xml
+++ b/packages/SystemUI/res/drawable/qs_security_footer_background.xml
@@ -28,8 +28,7 @@
</item>
<item>
<shape android:shape="rectangle">
- <stroke android:width="1dp"
- android:color="?android:attr/colorBackground"/>
+ <solid android:color="?attr/offStateColor"/>
<corners android:radius="@dimen/qs_security_footer_corner_radius"/>
</shape>
</item>
diff --git a/packages/SystemUI/res/layout/combined_qs_header.xml b/packages/SystemUI/res/layout/combined_qs_header.xml
index 1f10e5dfeed8..4e46c42a053a 100644
--- a/packages/SystemUI/res/layout/combined_qs_header.xml
+++ b/packages/SystemUI/res/layout/combined_qs_header.xml
@@ -26,7 +26,7 @@
android:paddingLeft="@dimen/qs_panel_padding"
android:paddingRight="@dimen/qs_panel_padding"
android:visibility="gone"
- android:theme="@style/Theme.SystemUI.QuickSettings.Header"
+ android:theme="@style/QSHeaderTheme"
app:layoutDescription="@xml/combined_qs_header_scene">
<androidx.constraintlayout.widget.Guideline
@@ -101,4 +101,4 @@
app:layout_constraintBottom_toBottomOf="parent"
/>
-</androidx.constraintlayout.motion.widget.MotionLayout>
\ No newline at end of file
+</androidx.constraintlayout.motion.widget.MotionLayout>
diff --git a/packages/SystemUI/res/layout/split_shade_header.xml b/packages/SystemUI/res/layout/split_shade_header.xml
index b6e96ceeaf20..ecb017a3b606 100644
--- a/packages/SystemUI/res/layout/split_shade_header.xml
+++ b/packages/SystemUI/res/layout/split_shade_header.xml
@@ -25,7 +25,7 @@
android:paddingLeft="@dimen/qs_panel_padding"
android:paddingRight="@dimen/qs_panel_padding"
android:visibility="gone"
- android:theme="@style/Theme.SystemUI.QuickSettings.Header">
+ android:theme="@style/QSHeaderTheme">
<com.android.systemui.statusbar.policy.Clock
android:id="@+id/clock"
diff --git a/packages/SystemUI/res/values-night/styles.xml b/packages/SystemUI/res/values-night/styles.xml
index e82230ab5fbc..897f7ae00824 100644
--- a/packages/SystemUI/res/values-night/styles.xml
+++ b/packages/SystemUI/res/values-night/styles.xml
@@ -24,6 +24,18 @@
<item name="android:windowIsFloating">true</item>
</style>
+ <style name="Theme.SystemUI.QuickSettings" parent="@*android:style/Theme.DeviceDefault.SystemUI">
+ <item name="lightIconTheme">@style/QSIconTheme</item>
+ <item name="darkIconTheme">@style/QSIconTheme</item>
+ <item name="android:colorError">@*android:color/error_color_material_dark</item>
+ <item name="android:windowIsFloating">true</item>
+ <item name="android:homeAsUpIndicator">@drawable/ic_arrow_back</item>
+ <item name="offStateColor">@android:color/system_neutral1_800</item>
+ <item name="underSurfaceColor">@android:color/system_neutral1_900</item>
+ <item name="android:colorBackground">@android:color/system_neutral1_900</item>
+ <item name="android:itemTextAppearance">@style/Control.MenuItem</item>
+ </style>
+
<style name="TextAppearance.QS.Status" parent="TextAppearance.QS.TileLabel.Secondary">
<item name="android:fontFamily">@*android:string/config_bodyFontFamilyMedium</item>
<item name="android:textColor">?android:attr/textColorPrimary</item>
diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml
index e2665f879e5e..47344cb6d352 100644
--- a/packages/SystemUI/res/values/styles.xml
+++ b/packages/SystemUI/res/values/styles.xml
@@ -329,12 +329,12 @@
<style name="Theme.SystemUI.QuickSettings" parent="@*android:style/Theme.DeviceDefault.SystemUI">
<item name="lightIconTheme">@style/QSIconTheme</item>
<item name="darkIconTheme">@style/QSIconTheme</item>
- <item name="android:colorError">@*android:color/error_color_material_dark</item>
+ <item name="android:colorError">@*android:color/error_color_material_light</item>
<item name="android:windowIsFloating">true</item>
<item name="android:homeAsUpIndicator">@drawable/ic_arrow_back</item>
- <item name="offStateColor">@android:color/system_neutral1_800</item>
- <item name="underSurfaceColor">@android:color/system_neutral1_1000</item>
- <item name="android:colorBackground">@android:color/system_neutral1_900</item>
+ <item name="offStateColor">@*android:color/surface_light</item>
+ <item name="underSurfaceColor">@android:color/system_neutral1_50</item>
+ <item name="android:colorBackground">@android:color/system_neutral1_50</item>
<item name="android:itemTextAppearance">@style/Control.MenuItem</item>
</style>
@@ -540,7 +540,7 @@
<style name="QSCustomizeToolbar" parent="@*android:style/Widget.DeviceDefault.Toolbar">
<item name="android:textColor">?android:attr/textColorPrimary</item>
- <item name="android:elevation">10dp</item>
+ <item name="android:elevation">0dp</item>
</style>
<!-- Media controls always have light background -->
diff --git a/packages/SystemUI/src/com/android/systemui/privacy/OngoingPrivacyChip.kt b/packages/SystemUI/src/com/android/systemui/privacy/OngoingPrivacyChip.kt
index 9cd97ff8e343..461f67935a11 100644
--- a/packages/SystemUI/src/com/android/systemui/privacy/OngoingPrivacyChip.kt
+++ b/packages/SystemUI/src/com/android/systemui/privacy/OngoingPrivacyChip.kt
@@ -90,8 +90,8 @@ class OngoingPrivacyChip @JvmOverloads constructor(
.getDimensionPixelSize(R.dimen.ongoing_appops_chip_icon_margin)
iconSize = context.resources
.getDimensionPixelSize(R.dimen.ongoing_appops_chip_icon_size)
- iconColor =
- Utils.getColorAttrDefaultColor(context, com.android.internal.R.attr.colorPrimary)
+ iconColor = context.resources
+ .getColor(android.R.color.system_neutral1_900)
val padding = context.resources
.getDimensionPixelSize(R.dimen.ongoing_appops_chip_side_padding)
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileViewImpl.kt b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileViewImpl.kt
index 9d60e63032c3..405080c32807 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileViewImpl.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileViewImpl.kt
@@ -83,7 +83,7 @@ open class QSTileViewImpl @JvmOverloads constructor(
}
private val colorActive = Utils.getColorAttrDefaultColor(context,
- com.android.internal.R.attr.colorAccentPrimary)
+ android.R.attr.colorAccent)
private val colorInactive = Utils.getColorAttrDefaultColor(context, R.attr.offStateColor)
private val colorUnavailable = Utils.applyAlpha(UNAVAILABLE_ALPHA, colorInactive)
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 1077347eab0a..fd44a9b5a5b3 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
@@ -704,7 +704,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
mNotificationsAlpha = behindAlpha;
mNotificationsTint = behindTint;
mBehindAlpha = 1;
- mBehindTint = Color.BLACK;
+ mBehindTint = Color.TRANSPARENT;
} else {
mBehindAlpha = behindAlpha;
if (mState == ScrimState.SHADE_LOCKED) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimState.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimState.java
index 9246c0e73289..b30641bbf1af 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimState.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimState.java
@@ -82,7 +82,7 @@ public enum ScrimState {
mBehindAlpha = mClipQsScrim ? 1 : mScrimBehindAlphaKeyguard;
mNotifAlpha = mClipQsScrim ? mScrimBehindAlphaKeyguard : 0;
if (mClipQsScrim) {
- updateScrimColor(mScrimBehind, 1f /* alpha */, Color.BLACK);
+ updateScrimColor(mScrimBehind, 1f /* alpha */, Color.TRANSPARENT);
}
}
},
@@ -119,7 +119,7 @@ public enum ScrimState {
@Override
public void prepare(ScrimState previousState) {
mBehindAlpha = mClipQsScrim ? 1 : mDefaultScrimAlpha;
- mBehindTint = mClipQsScrim ? Color.BLACK : Color.TRANSPARENT;
+ mBehindTint = Color.TRANSPARENT;
mNotifAlpha = mClipQsScrim ? mDefaultScrimAlpha : 0;
mNotifTint = Color.TRANSPARENT;
mFrontAlpha = 0f;
@@ -143,17 +143,17 @@ public enum ScrimState {
mBehindAlpha = mClipQsScrim ? 1 : mDefaultScrimAlpha;
mNotifAlpha = 1f;
mFrontAlpha = 0f;
- mBehindTint = Color.BLACK;
+ mBehindTint = Color.TRANSPARENT;
if (mClipQsScrim) {
- updateScrimColor(mScrimBehind, 1f /* alpha */, Color.BLACK);
+ updateScrimColor(mScrimBehind, 1f /* alpha */, Color.TRANSPARENT);
}
}
// to make sure correct color is returned before "prepare" is called
@Override
public int getBehindTint() {
- return Color.BLACK;
+ return Color.TRANSPARENT;
}
},
@@ -244,22 +244,22 @@ public enum ScrimState {
mAnimateChange = !mLaunchingAffordanceWithPreview && !fromAod;
mFrontTint = Color.TRANSPARENT;
- mBehindTint = Color.BLACK;
+ mBehindTint = Color.TRANSPARENT;
mBlankScreen = false;
if (previousState == ScrimState.AOD) {
// Set all scrims black, before they fade transparent.
updateScrimColor(mScrimInFront, 1f /* alpha */, Color.BLACK /* tint */);
- updateScrimColor(mScrimBehind, 1f /* alpha */, Color.BLACK /* tint */);
+ updateScrimColor(mScrimBehind, 1f /* alpha */, Color.TRANSPARENT /* tint */);
// Scrims should still be black at the end of the transition.
mFrontTint = Color.BLACK;
- mBehindTint = Color.BLACK;
+ mBehindTint = Color.TRANSPARENT;
mBlankScreen = true;
}
if (mClipQsScrim) {
- updateScrimColor(mScrimBehind, 1f /* alpha */, Color.BLACK);
+ updateScrimColor(mScrimBehind, 1f /* alpha */, Color.TRANSPARENT);
}
}
};
@@ -399,4 +399,4 @@ public enum ScrimState {
public void setClipQsScrim(boolean clipsQsScrim) {
mClipQsScrim = clipsQsScrim;
}
-}
\ No newline at end of file
+}
--
2.25.1

View File

@@ -1,34 +0,0 @@
From 51ddcd1625e36db7a7817c8fdcf78008e3dcc472 Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Mon, 11 Oct 2021 19:25:02 -0700
Subject: [PATCH 16/19] SystemUI: Initialize QS tiles in inactive state
Now that the QS fragment is recreated when changing the UI mode (so that
it follows light/dark themes), all tiles flash with active color briefly
because the new views become visible before states are refreshed.
Initializing tiles in the inactive state is much less disruptive, and
the effect is very hard to see as compared to the active color because
the background color is much less prominent.
Change-Id: I048171d503f5533e91bab486b8805ac15c329f31
---
.../plugin/src/com/android/systemui/plugins/qs/QSTile.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/SystemUI/plugin/src/com/android/systemui/plugins/qs/QSTile.java b/packages/SystemUI/plugin/src/com/android/systemui/plugins/qs/QSTile.java
index 77018d736163..9e02b140175b 100644
--- a/packages/SystemUI/plugin/src/com/android/systemui/plugins/qs/QSTile.java
+++ b/packages/SystemUI/plugin/src/com/android/systemui/plugins/qs/QSTile.java
@@ -148,7 +148,7 @@ public interface QSTile {
@ProvidesInterface(version = State.VERSION)
public static class State {
public static final int VERSION = 1;
- public static final int DEFAULT_STATE = Tile.STATE_ACTIVE;
+ public static final int DEFAULT_STATE = Tile.STATE_INACTIVE;
public Icon icon;
public Supplier<Icon> iconSupplier;
--
2.25.1

View File

@@ -1,147 +0,0 @@
From 8015abe8a29cf35760b18691a8e732f0d1b84b65 Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Mon, 11 Oct 2021 19:25:08 -0700
Subject: [PATCH 17/19] SystemUI: Add dual-tone light and dark themes for QS
Google's dual-tone QS design where the notification panel has a
semantically higher elevation adds depth to the notification+QS shade,
and we don't necessarily have to give it up just because our QS has
light and dark themes.
To preserve the dual-tone effect, use a darker background color for the
QS section:
Light:
Notifications: neutral1 20 (surface_light)
Notification panel: neutral1 50 (light BG)
QS background: neutral1 100 (darker light BG / surface_header_light)
Inactive QS tiles: neutral1 20 (surface_light)
Dark:
Notifications: neutral1 800 (surface_dark)
Notification panel: neutral1 900 (dark BG)
QS background: neutral1 950 (surface_header_dark_sysui modulated to L* 5)
Inactive QS tiles: neutral1 800 (surface_dark)
The dark QS background could be neutral1 0 (black) like it was before,
but I don't think it looks as good because it can't be tinted based on
the active wallpaper and thus stands out from other colors.
Unfortunately, Google's current CAM16-based modulation causes hue shifts
in extreme light and dark shades (e.g. L* = 98 / 5), but we'll fix this
by generating and overlaying modulated surface colors in our
ThemeOverlayController implementation.
Demo screenshots: https://twitter.com/kdrag0n/status/1445922541218922496
Change-Id: Icdc4957ecb4e0201377351f1a3e1c6928d6b3955
---
.../res/color/surface_header_dark_sysui.xml | 18 ++++++++++++++++++
core/res/res/values-night/values.xml | 1 +
packages/SystemUI/res/values/styles.xml | 2 +-
.../statusbar/phone/ScrimController.java | 13 ++++++++++++-
4 files changed, 32 insertions(+), 2 deletions(-)
create mode 100644 core/res/res/color/surface_header_dark_sysui.xml
diff --git a/core/res/res/color/surface_header_dark_sysui.xml b/core/res/res/color/surface_header_dark_sysui.xml
new file mode 100644
index 000000000000..ec070c96f91a
--- /dev/null
+++ b/core/res/res/color/surface_header_dark_sysui.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2021 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.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ 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="@color/system_neutral1_500" android:lStar="5" />
+</selector>
diff --git a/core/res/res/values-night/values.xml b/core/res/res/values-night/values.xml
index 1571fab66a5b..0683c20a4a4c 100644
--- a/core/res/res/values-night/values.xml
+++ b/core/res/res/values-night/values.xml
@@ -22,6 +22,7 @@
<item name="colorSecondary">@color/secondary_device_default_settings</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
<item name="colorError">@color/error_color_device_default_dark</item>
+ <item name="colorSurfaceHeader">@color/surface_header_dark_sysui</item>
<item name="colorControlNormal">?attr/textColorPrimary</item>
<item name="alertDialogTheme">@style/Theme.DeviceDefault.Dialog.Alert</item>
<item name="forceDarkAllowed">false</item>
diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml
index 47344cb6d352..ba0361de6e8b 100644
--- a/packages/SystemUI/res/values/styles.xml
+++ b/packages/SystemUI/res/values/styles.xml
@@ -333,7 +333,7 @@
<item name="android:windowIsFloating">true</item>
<item name="android:homeAsUpIndicator">@drawable/ic_arrow_back</item>
<item name="offStateColor">@*android:color/surface_light</item>
- <item name="underSurfaceColor">@android:color/system_neutral1_50</item>
+ <item name="underSurfaceColor">@android:color/system_neutral1_100</item>
<item name="android:colorBackground">@android:color/system_neutral1_50</item>
<item name="android:itemTextAppearance">@style/Control.MenuItem</item>
</style>
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 fd44a9b5a5b3..00db68981eb6 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
@@ -180,6 +180,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
private UnlockedScreenOffAnimationController mUnlockedScreenOffAnimationController;
private GradientColors mColors;
+ private GradientColors mBehindColors;
private boolean mNeedsDrawableColorUpdate;
private float mScrimBehindAlphaKeyguard = KEYGUARD_SCRIM_ALPHA;
@@ -276,6 +277,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
);
mColors = new GradientColors();
+ mBehindColors = new GradientColors();
}
/**
@@ -874,7 +876,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
&& !mBlankScreen;
mScrimInFront.setColors(mColors, animateScrimInFront);
- mScrimBehind.setColors(mColors, animateBehindScrim);
+ mScrimBehind.setColors(mBehindColors, animateBehindScrim);
mNotificationsScrim.setColors(mColors, animateScrimNotifications);
dispatchBackScrimState(mScrimBehind.getViewAlpha());
@@ -1214,11 +1216,20 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
if (mScrimBehind == null) return;
int background = Utils.getColorAttr(mScrimBehind.getContext(),
android.R.attr.colorBackgroundFloating).getDefaultColor();
+ int surfaceBackground = Utils.getColorAttr(mScrimBehind.getContext(),
+ com.android.internal.R.attr.colorSurfaceHeader).getDefaultColor();
int accent = Utils.getColorAccent(mScrimBehind.getContext()).getDefaultColor();
+
mColors.setMainColor(background);
mColors.setSecondaryColor(accent);
mColors.setSupportsDarkText(
ColorUtils.calculateContrast(mColors.getMainColor(), Color.WHITE) > 4.5);
+
+ mBehindColors.setMainColor(surfaceBackground);
+ mBehindColors.setSecondaryColor(accent);
+ mBehindColors.setSupportsDarkText(
+ ColorUtils.calculateContrast(mBehindColors.getMainColor(), Color.WHITE) > 4.5);
+
mNeedsDrawableColorUpdate = true;
}
--
2.25.1