Changes for April 2024

This commit is contained in:
Andy CrossGate Yan
2024-04-21 16:33:07 +08:00
parent ea765d3ff5
commit 94f14a03d8
103 changed files with 2234 additions and 1162 deletions

View File

@@ -1,7 +1,7 @@
From 9d54280afa329e036ba97cd5f39e1371c4beea0a Mon Sep 17 00:00:00 2001
From 92d00894b0d84c8d3fd0a6ba253132ac96402251 Mon Sep 17 00:00:00 2001
From: AndyCGYan <GeForce8800Ultra@gmail.com>
Date: Fri, 22 Mar 2019 00:41:20 +0800
Subject: [PATCH 01/31] Disable FP lockouts optionally
Subject: [PATCH 01/34] Disable FP lockouts optionally
Both timed and permanent lockouts - GET THE FUCK OUT
Now targeting LockoutFramework, introduced in Android 12
@@ -13,7 +13,7 @@ Change-Id: I2d4b091f3546d4d7903bfb4d5585629212dc9915
1 file changed, 17 insertions(+), 11 deletions(-)
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/LockoutFrameworkImpl.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/LockoutFrameworkImpl.java
index 36d56c8a1544..7ee15e97a383 100644
index 0730c672acd9..972421758223 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/LockoutFrameworkImpl.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/LockoutFrameworkImpl.java
@@ -27,6 +27,7 @@ import android.content.IntentFilter;
@@ -32,10 +32,10 @@ index 36d56c8a1544..7ee15e97a383 100644
private final class LockoutReceiver extends BroadcastReceiver {
@Override
@@ -105,23 +107,27 @@ public class LockoutFrameworkImpl implements LockoutTracker {
}
@@ -107,24 +109,28 @@ public class LockoutFrameworkImpl implements LockoutTracker {
void addFailedAttemptForUser(int userId) {
@Override
public void addFailedAttemptForUser(int userId) {
- mFailedAttempts.put(userId, mFailedAttempts.get(userId, 0) + 1);
- mTimedLockoutCleared.put(userId, false);
+ if (!SystemProperties.getBoolean(DISABLE_FP_LOCKOUTS_PROPERTY, false)) {
@@ -51,7 +51,8 @@ index 36d56c8a1544..7ee15e97a383 100644
}
@Override
public @LockoutMode int getLockoutModeForUser(int userId) {
@LockoutMode
public int getLockoutModeForUser(int userId) {
- final int failedAttempts = mFailedAttempts.get(userId, 0);
- if (failedAttempts >= MAX_FAILED_ATTEMPTS_LOCKOUT_PERMANENT) {
- return LOCKOUT_PERMANENT;

View File

@@ -1,22 +1,21 @@
From cdbb1b13a0c0577db791e0826e55cbd922a3d533 Mon Sep 17 00:00:00 2001
From b3aa7feea26bb5d713a8511f5720f33f0c204002 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/31] Disable vendor mismatch warning
Subject: [PATCH 02/34] Disable vendor mismatch warning
Change-Id: Ieb8fe91e2f02462f074312ed0f4885d183e9780b
---
.../server/wm/ActivityTaskManagerService.java | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)
.../server/wm/ActivityTaskManagerService.java | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
diff --git a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
index 8382fa97c5c5..a3e37193d513 100644
index ad9ac201e22b..b42e4e2e22dc 100644
--- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
+++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
@@ -6116,20 +6116,8 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
}
@@ -6237,19 +6237,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
if (!Build.isBuildConsistent()) {
- Slog.e(TAG, "Build fingerprint is not consistent, warning user");
if (!isBuildConsistent) {
Slog.e(TAG, "Build fingerprint is not consistent, warning user");
- mUiHandler.post(() -> {
- if (mShowDialogs) {
- AlertDialog d = new BaseErrorDialog(mUiContext);
@@ -30,11 +29,10 @@ index 8382fa97c5c5..a3e37193d513 100644
- d.show();
- }
- });
+ Slog.e(TAG, "Build fingerprint is not consistent");
+ // Do not emit warning about vendor mismatch
}
}
}
Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER);
--
2.34.1

View File

@@ -1,7 +1,7 @@
From dc1b9d58a7f5522fb1c5b7155b52c733b9f5080d Mon Sep 17 00:00:00 2001
From e492a141400c534bfc1f08b904e7e7f60e92164e Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 21 Jan 2024 22:03:47 +0800
Subject: [PATCH 03/31] Keyguard: Allow locking to any rotation mode
Subject: [PATCH 03/34] Keyguard: Allow locking to any rotation mode
Change-Id: I0f12c433f3547e9bfcdbc2cf50e2a4f3ec8ca311
---
@@ -9,10 +9,10 @@ Change-Id: I0f12c433f3547e9bfcdbc2cf50e2a4f3ec8ca311
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowControllerImpl.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowControllerImpl.java
index 2ebe2bcf7099..6e51746c6ea7 100644
index b4082694bbe5..f9f3dd911a74 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowControllerImpl.java
@@ -382,12 +382,9 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW
@@ -431,12 +431,9 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW
}
private void adjustScreenOrientation(NotificationShadeWindowState state) {

View File

@@ -1,7 +1,7 @@
From 966dbb52453bb6bd3d301a23c6ab4101951a2489 Mon Sep 17 00:00:00 2001
From beea20462b965e2c790549f7d854ed71b46b54e9 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Tue, 17 Jan 2023 17:19:19 +0000
Subject: [PATCH 04/31] Keyguard: Fix colors of slices not updating on doze
Subject: [PATCH 04/34] Keyguard: Fix colors of slices not updating on doze
Slices were invisible (black) in doze when using light wallpapers
Introduced in https://github.com/LineageOS/android_frameworks_base/commit/a19e59d717ec6d573c11c7e8277bba3c4de189c2
@@ -13,10 +13,10 @@ Change-Id: I06abd8bf2e28655cc9e6d81366fd82a13454ec5a
2 files changed, 8 insertions(+)
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java
index c314586e4a21..5262a2c04c00 100644
index 2a54a4eee657..de2d1ec89b61 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java
@@ -207,6 +207,13 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV
@@ -297,6 +297,13 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV
mKeyguardSliceViewController.refresh();
}
@@ -31,10 +31,10 @@ index c314586e4a21..5262a2c04c00 100644
* Set which clock should be displayed on the keyguard. The other one will be automatically
* hidden.
diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
index 87eeff2c3157..8d531913b3c0 100644
index 6aa11143f21e..b0ae87580292 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
@@ -4637,6 +4637,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
@@ -4551,6 +4551,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
public void onDozeAmountChanged(float linearAmount, float amount) {
mInterpolatedDarkAmount = amount;
mLinearDarkAmount = linearAmount;

View File

@@ -1,7 +1,7 @@
From 2ef56aadc11858d1cddad3a4b0083a3708d6528c Mon Sep 17 00:00:00 2001
From 5ee95318ee1be083a2a2569be7362fcafd8fbc94 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 05/31] UI: Adjust default navbar layouts
Subject: [PATCH 05/34] 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,10 +45,10 @@ 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 f530d0d6e06f..9cd22313e0a1 100644
index 038e9da33b83..4791ad8969f0 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -315,7 +315,7 @@
@@ -325,7 +325,7 @@
</string-array>
<!-- Nav bar button default ordering/layout -->

View File

@@ -1,7 +1,7 @@
From 78487f8b35969298a76f61ae71651f537fe8e90e Mon Sep 17 00:00:00 2001
From 5b8bc8a9cf51ed8fb40101b7a5234fccaee36327 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 06/31] UI: Adjust split-screen divider
Subject: [PATCH 06/34] UI: Adjust split-screen divider
- Kill rounded corners - where two rectangles collide should be perfectly straight
- Make it black (pre-Sv2) for phones
@@ -150,7 +150,7 @@ index 000000000000..8a1907da76e5
+ <color name="split_divider_background">@color/taskbar_background</color>
+</resources>
diff --git a/libs/WindowManager/Shell/res/values/colors.xml b/libs/WindowManager/Shell/res/values/colors.xml
index b2ec98bc1b15..b21a6f50c9ab 100644
index fae71efe3b39..fb50f0119b43 100644
--- a/libs/WindowManager/Shell/res/values/colors.xml
+++ b/libs/WindowManager/Shell/res/values/colors.xml
@@ -18,7 +18,7 @@
@@ -163,10 +163,10 @@ index b2ec98bc1b15..b21a6f50c9ab 100644
<color name="minimize_dock_shadow_start">#60000000</color>
<color name="minimize_dock_shadow_end">#00000000</color>
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java
index 755dba0c895f..9a2c9bfdab5d 100644
index 53caddb52f23..fae5008283cc 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java
@@ -157,23 +157,8 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange
@@ -168,23 +168,8 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange
}
private void updateDividerConfig(Context context) {

View File

@@ -1,7 +1,7 @@
From 2df74582c930fc05aa5eeed48ed766d74652bf45 Mon Sep 17 00:00:00 2001
From f9879e5977ca089dae074c63e609a2a5bc734199 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 07/31] UI: Disable wallpaper zoom
Subject: [PATCH 07/34] 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 04a69f8c1e6d..15c4a37b76cd 100644
index 3bc33bac37bc..369eb84ccd84 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -5534,7 +5534,7 @@
@@ -5768,7 +5768,7 @@
<item name="config_wallpaperMinScale" format="float" type="dimen">1</item>
<!-- The max scale for the wallpaper when it's zoomed in -->

View File

@@ -1,7 +1,7 @@
From 1f5882a5305f1a5e01ebfcd3cc7fb30faaa69074 Mon Sep 17 00:00:00 2001
From 2ffb66fa7c00b63536c3de706bd6e36b2b696512 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 25 Sep 2022 02:20:52 +0000
Subject: [PATCH 08/31] UI: Follow Monet and light/dark theme in user 1 icon
Subject: [PATCH 08/34] UI: Follow Monet and light/dark theme in user 1 icon
Change-Id: I755077c6003c39ddc9428da1defe6a6ddd0e5ff8
---
@@ -22,10 +22,10 @@ index d3f998fb70cf..4f7b9e093bb7 100644
<color name="user_icon_6">#ff4ecde6</color><!-- cyan -->
<color name="user_icon_7">#fffbbc04</color><!-- yellow -->
diff --git a/core/res/res/values/colors.xml b/core/res/res/values/colors.xml
index a6830a6e3793..bbeb4e371018 100644
index eddd81e78692..00cf4243cfa9 100644
--- a/core/res/res/values/colors.xml
+++ b/core/res/res/values/colors.xml
@@ -176,7 +176,7 @@
@@ -177,7 +177,7 @@
<color name="system_notification_accent_color">#00000000</color>
<!-- Default user icon colors -->

View File

@@ -0,0 +1,40 @@
From 17eb4477f1607ea91917ddce4137d7e337d3037b Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Thu, 4 Apr 2024 18:19:19 +0800
Subject: [PATCH 09/34] UI: Hide QS footer background
Change-Id: I4d83037e9206dec4181f9b0acd302114fa4a98c1
---
.../com/android/systemui/qs/footer/ui/compose/FooterActions.kt | 2 +-
packages/SystemUI/res/drawable/qs_footer_actions_background.xml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/qs/footer/ui/compose/FooterActions.kt b/packages/SystemUI/compose/features/src/com/android/systemui/qs/footer/ui/compose/FooterActions.kt
index eb71490f049a..8242afefc56b 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/qs/footer/ui/compose/FooterActions.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/qs/footer/ui/compose/FooterActions.kt
@@ -119,7 +119,7 @@ fun FooterActions(
}
}
- val backgroundColor = colorAttr(R.attr.underSurface)
+ val backgroundColor = colorAttr(android.R.color.transparent)
val contentColor = LocalAndroidColorScheme.current.onSurface
val backgroundTopRadius = dimensionResource(R.dimen.qs_corner_radius)
val backgroundModifier =
diff --git a/packages/SystemUI/res/drawable/qs_footer_actions_background.xml b/packages/SystemUI/res/drawable/qs_footer_actions_background.xml
index a7e8762a2593..6bfa8f75de03 100644
--- a/packages/SystemUI/res/drawable/qs_footer_actions_background.xml
+++ b/packages/SystemUI/res/drawable/qs_footer_actions_background.xml
@@ -15,7 +15,7 @@
-->
<inset xmlns:android="http://schemas.android.com/apk/res/android">
<shape>
- <solid android:color="?attr/underSurface"/>
+ <solid android:color="@android:color/transparent"/>
<corners android:topLeftRadius="@dimen/qs_corner_radius"
android:topRightRadius="@dimen/qs_corner_radius"/>
</shape>
--
2.34.1

View File

@@ -1,7 +1,7 @@
From 0f62a57ac11e78a3595ba7598f151e7fd891e7c1 Mon Sep 17 00:00:00 2001
From 0e9361f835650e386bb6b797ebb1b6852d40c762 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 09/31] UI: Increase default status bar height
Subject: [PATCH 10/34] UI: Increase default status bar height
Change-Id: Ibbcf63159e19bb2bb2b1094ea07ab85917630b07
---
@@ -9,7 +9,7 @@ Change-Id: Ibbcf63159e19bb2bb2b1094ea07ab85917630b07
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml
index 190b7a62e2e0..32589b542a1d 100644
index 96c4bf432c05..a086f16c769e 100644
--- a/core/res/res/values/dimens.xml
+++ b/core/res/res/values/dimens.xml
@@ -41,7 +41,7 @@

View File

@@ -1,26 +0,0 @@
From 7efb158bc07f7366ff2d2d92752e663e16c9e03d Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 25 Sep 2022 02:20:20 +0000
Subject: [PATCH 10/31] UI: Remove QS footer background
Change-Id: I68e82e0c5e3eddb2d3f767fe792b1436eae506ef
---
packages/SystemUI/res-keyguard/layout/footer_actions.xml | 1 -
1 file changed, 1 deletion(-)
diff --git a/packages/SystemUI/res-keyguard/layout/footer_actions.xml b/packages/SystemUI/res-keyguard/layout/footer_actions.xml
index 4a2a1cb9dc6d..b7f30d9e4344 100644
--- a/packages/SystemUI/res-keyguard/layout/footer_actions.xml
+++ b/packages/SystemUI/res-keyguard/layout/footer_actions.xml
@@ -23,7 +23,6 @@
android:elevation="@dimen/qs_panel_elevation"
android:paddingTop="@dimen/qs_footer_actions_top_padding"
android:paddingBottom="@dimen/qs_footer_actions_bottom_padding"
- android:background="@drawable/qs_footer_actions_background"
android:gravity="center_vertical|end"
android:layout_gravity="bottom"
/>
\ No newline at end of file
--
2.34.1

View File

@@ -0,0 +1,82 @@
From 635207ed57659f3c89cfa144de981706c569d9c8 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 11/34] UI: Revive navbar layout tuning via sysui_nav_bar
tunable
Google keeps fixing what ain't broken.
Change-Id: Ied7d7859e50fd0fcc346219964e747c5d5f4c352
---
.../NavigationBarInflaterView.java | 21 +++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarInflaterView.java b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarInflaterView.java
index 73ca35557133..bbb312c4e56b 100644
--- a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarInflaterView.java
+++ b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarInflaterView.java
@@ -135,6 +135,7 @@ public class NavigationBarInflaterView extends FrameLayout {
private boolean mInverseLayout;
private boolean mIsHintEnabled;
+ private boolean mUsingCustomLayout;
private final ContentObserver mContentObserver;
@@ -159,6 +160,9 @@ public class NavigationBarInflaterView extends FrameLayout {
mContext.getMainExecutor().execute(() -> {
onLikelyDefaultLayoutChange();
});
+ } else if (Settings.Secure.getUriFor(NAV_BAR_VIEWS).equals(uri)) {
+ setNavigationBarLayout(Settings.Secure.getString(mContext.getContentResolver(),
+ NAV_BAR_VIEWS));
}
}
};
@@ -215,12 +219,16 @@ public class NavigationBarInflaterView extends FrameLayout {
Uri navBarInverse = Settings.Secure.getUriFor(NAV_BAR_INVERSE);
Uri navigationBarHint = LineageSettings.System.getUriFor(
LineageSettings.System.NAVIGATION_BAR_HINT);
+ Uri navBarViews = Settings.Secure.getUriFor(NAV_BAR_VIEWS);
mContext.getContentResolver().registerContentObserver(navBarInverse, false,
mContentObserver);
mContext.getContentResolver().registerContentObserver(navigationBarHint, false,
mContentObserver);
+ mContext.getContentResolver().registerContentObserver(navBarViews, false,
+ mContentObserver);
mContentObserver.onChange(true, navBarInverse);
mContentObserver.onChange(true, navigationBarHint);
+ mContentObserver.onChange(true, navBarViews);
}
@Override
@@ -237,6 +245,9 @@ public class NavigationBarInflaterView extends FrameLayout {
}
public void onLikelyDefaultLayoutChange() {
+ // Don't override custom layouts
+ if (mUsingCustomLayout) return;
+
// Reevaluate new layout
final String newValue = getDefaultLayout();
if (!Objects.equals(mCurrentLayout, newValue)) {
@@ -245,6 +256,16 @@ public class NavigationBarInflaterView extends FrameLayout {
}
}
+ public void setNavigationBarLayout(String layoutValue) {
+ mContext.getMainExecutor().execute(() -> {
+ if (!Objects.equals(mCurrentLayout, layoutValue)) {
+ mUsingCustomLayout = layoutValue != null;
+ clearViews();
+ inflateLayout(layoutValue);
+ }
+ });
+ }
+
public void setButtonDispatchers(SparseArray<ButtonDispatcher> buttonDispatchers) {
mButtonDispatchers = buttonDispatchers;
clearDispatcherViews();
--
2.34.1

View File

@@ -1,7 +1,7 @@
From 1edb91ecfa56336cc94aa2bd49c1a3e07274447a Mon Sep 17 00:00:00 2001
From b2ca16f3b497b0f69e125eb9f47f2324d2a2019e 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 11/31] UI: Use SNAP_FIXED_RATIO for multi-window globally
Subject: [PATCH 12/34] UI: Use SNAP_FIXED_RATIO for multi-window globally
Enables multiple snap targets under landscape for phone UI
@@ -78,10 +78,10 @@ index 34b6a54be493..3921c9edfeac 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 15c4a37b76cd..43dbb1513f8a 100644
index 369eb84ccd84..c223ec0d6ed0 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -4081,7 +4081,7 @@
@@ -4203,7 +4203,7 @@
1 - 3 snap targets: fixed ratio, 1:1, (1 - fixed ratio)
2 - 1 snap target: 1:1
-->

View File

@@ -1,7 +1,7 @@
From 5dbac2415145bea20ff01debbe03e815bce09334 Mon Sep 17 00:00:00 2001
From 77275322ff6606110bec9f11bbdc90932ab1fded Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Tue, 3 Nov 2020 22:43:12 -0800
Subject: [PATCH 12/31] core: Remove old app target SDK dialog
Subject: [PATCH 13/34] 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
@@ -15,10 +15,10 @@ Change-Id: I1a3021f0f9bec1ab6ff7641776391e1bd4c3cc49
1 file changed, 1 deletion(-)
diff --git a/services/core/java/com/android/server/wm/AppWarnings.java b/services/core/java/com/android/server/wm/AppWarnings.java
index 0273a30e157c..d54aadfd6d24 100644
index ad5f4427fbc4..94ccee7b4771 100644
--- a/services/core/java/com/android/server/wm/AppWarnings.java
+++ b/services/core/java/com/android/server/wm/AppWarnings.java
@@ -206,7 +206,6 @@ class AppWarnings {
@@ -210,7 +210,6 @@ class AppWarnings {
public void onStartActivity(ActivityRecord r) {
showUnsupportedCompileSdkDialogIfNeeded(r);
showUnsupportedDisplaySizeDialogIfNeeded(r);

View File

@@ -1,163 +0,0 @@
From 1001116630f817f53c2b6adbe51499ca6ff6ab4f Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Sat, 16 Oct 2021 05:27:57 -0700
Subject: [PATCH 14/31] Add support for app signature spoofing
This is needed by microG GmsCore to pretend to be the official Google
Play Services package, because client apps check the package signature
to make sure it matches Google's official certificate.
This was forward-ported from the Android 10 patch by gudenau:
https://github.com/microg/android_packages_apps_GmsCore/pull/957
Changes made for Android 11:
- Updated PackageInfo calls
- Added new permission to public API surface, needed for
PermissionController which is now an updatable APEX on 11
- Added a dummy permission group to allow users to manage the
permission through the PermissionController UI
(by Vachounet <vachounet@live.fr>)
- Updated location provider comment for conciseness
Changes made for Android 12:
- Moved mayFakeSignature into lock-free Computer subclass
- Always get permissions for packages that request signature spoofing
(otherwise permissions are usually ommitted and thus the permission
check doesn't work properly)
- Optimize mayFakeSignature check order to improve performance
Changes made for Android 13:
- Computer subclass is now an independent class.
Change-Id: Ied7d6ce0b83a2d2345c3abba0429998d86494a88
---
core/api/current.txt | 2 ++
core/res/AndroidManifest.xml | 15 ++++++++++
core/res/res/values/strings.xml | 12 ++++++++
.../com/android/server/pm/ComputerEngine.java | 30 +++++++++++++++++--
4 files changed, 56 insertions(+), 3 deletions(-)
diff --git a/core/api/current.txt b/core/api/current.txt
index 288ab479c0fb..2124d89c6e6f 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -95,6 +95,7 @@ package android {
field public static final String EXECUTE_APP_ACTION = "android.permission.EXECUTE_APP_ACTION";
field public static final String EXPAND_STATUS_BAR = "android.permission.EXPAND_STATUS_BAR";
field public static final String FACTORY_TEST = "android.permission.FACTORY_TEST";
+ field public static final String FAKE_PACKAGE_SIGNATURE = "android.permission.FAKE_PACKAGE_SIGNATURE";
field public static final String FOREGROUND_SERVICE = "android.permission.FOREGROUND_SERVICE";
field public static final String FOREGROUND_SERVICE_CAMERA = "android.permission.FOREGROUND_SERVICE_CAMERA";
field public static final String FOREGROUND_SERVICE_CONNECTED_DEVICE = "android.permission.FOREGROUND_SERVICE_CONNECTED_DEVICE";
@@ -326,6 +327,7 @@ package android {
field public static final String CALL_LOG = "android.permission-group.CALL_LOG";
field public static final String CAMERA = "android.permission-group.CAMERA";
field public static final String CONTACTS = "android.permission-group.CONTACTS";
+ field public static final String FAKE_PACKAGE = "android.permission-group.FAKE_PACKAGE";
field public static final String LOCATION = "android.permission-group.LOCATION";
field public static final String MICROPHONE = "android.permission-group.MICROPHONE";
field public static final String NEARBY_DEVICES = "android.permission-group.NEARBY_DEVICES";
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 14cb052b121f..09dc7b293b73 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -4258,6 +4258,21 @@
android:description="@string/permdesc_getPackageSize"
android:protectionLevel="normal" />
+ <!-- Dummy user-facing group for faking package signature -->
+ <permission-group android:name="android.permission-group.FAKE_PACKAGE"
+ android:label="@string/permgrouplab_fake_package_signature"
+ android:description="@string/permgroupdesc_fake_package_signature"
+ android:request="@string/permgrouprequest_fake_package_signature"
+ android:priority="100" />
+
+ <!-- Allows an application to change the package signature as
+ seen by applications -->
+ <permission android:name="android.permission.FAKE_PACKAGE_SIGNATURE"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:protectionLevel="signature|privileged"
+ android:label="@string/permlab_fakePackageSignature"
+ android:description="@string/permdesc_fakePackageSignature" />
+
<!-- @deprecated No longer useful, see
{@link android.content.pm.PackageManager#addPackageToPreferred}
for details. -->
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 9c018c30f9e3..966fec172070 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -991,6 +991,18 @@
<!-- Permissions -->
+ <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
+ <string name="permlab_fakePackageSignature">Spoof package signature</string>
+ <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
+ <string name="permdesc_fakePackageSignature">Allows the app to pretend to be a different app. Malicious applications might be able to use this to access private application data. Legitimate uses include an emulator pretending to be what it emulates. Grant this permission with caution only!</string>
+ <!-- Title of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
+ <string name="permgrouplab_fake_package_signature">Spoof package signature</string>
+ <!-- Description of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
+ <string name="permgroupdesc_fake_package_signature">allow to spoof package signature</string>
+ <!-- Message shown to the user when the apps requests permission from this group. If ever possible this should stay below 80 characters (assuming the parameters takes 20 characters). Don't abbreviate until the message reaches 120 characters though. [CHAR LIMIT=120] -->
+ <string name="permgrouprequest_fake_package_signature">Allow
+ &lt;b><xliff:g id="app_name" example="Gmail">%1$s</xliff:g>&lt;/b> to spoof package signature?</string>
+
<!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
<string name="permlab_statusBar">disable or modify status bar</string>
<!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
diff --git a/services/core/java/com/android/server/pm/ComputerEngine.java b/services/core/java/com/android/server/pm/ComputerEngine.java
index 78f1fa60b69f..fb2f7da97cda 100644
--- a/services/core/java/com/android/server/pm/ComputerEngine.java
+++ b/services/core/java/com/android/server/pm/ComputerEngine.java
@@ -1450,6 +1450,29 @@ public class ComputerEngine implements Computer {
return result;
}
+ private boolean requestsFakeSignature(AndroidPackage p) {
+ return p.getMetaData() != null &&
+ p.getMetaData().getString("fake-signature") != null;
+ }
+
+ private PackageInfo mayFakeSignature(AndroidPackage p, PackageInfo pi,
+ Set<String> permissions) {
+ try {
+ if (p.getMetaData() != null &&
+ p.getTargetSdkVersion() > Build.VERSION_CODES.LOLLIPOP_MR1) {
+ String sig = p.getMetaData().getString("fake-signature");
+ if (sig != null &&
+ permissions.contains("android.permission.FAKE_PACKAGE_SIGNATURE")) {
+ pi.signatures = new Signature[] {new Signature(sig)};
+ }
+ }
+ } catch (Throwable t) {
+ // We should never die because of any failures, this is system code!
+ Log.w("PackageManagerService.FAKE_PACKAGE_SIGNATURE", t);
+ }
+ return pi;
+ }
+
public final PackageInfo generatePackageInfo(PackageStateInternal ps,
@PackageManager.PackageInfoFlagsBits long flags, int userId) {
if (!mUserManager.exists(userId)) return null;
@@ -1483,13 +1506,14 @@ public class ComputerEngine implements Computer {
|| ArrayUtils.isEmpty(p.getPermissions())) ? Collections.emptySet()
: mPermissionManager.getInstalledPermissions(ps.getPackageName());
// Compute granted permissions only if package has requested permissions
- final Set<String> grantedPermissions = ((flags & PackageManager.GET_PERMISSIONS) == 0
+ final Set<String> grantedPermissions = (((flags & PackageManager.GET_PERMISSIONS) == 0
+ && !requestsFakeSignature(p))
|| ArrayUtils.isEmpty(p.getRequestedPermissions())) ? Collections.emptySet()
: mPermissionManager.getGrantedPermissions(ps.getPackageName(), userId);
- PackageInfo packageInfo = PackageInfoUtils.generate(p, gids, flags,
+ PackageInfo packageInfo = mayFakeSignature(p, PackageInfoUtils.generate(p, gids, flags,
state.getFirstInstallTimeMillis(), ps.getLastUpdateTime(), installedPermissions,
- grantedPermissions, state, userId, ps);
+ grantedPermissions, state, userId, ps), grantedPermissions);
if (packageInfo == null) {
return null;
--
2.34.1

View File

@@ -1,7 +1,7 @@
From 11a651e734f3b32ca60f6a17d7b8a1f11cca5800 Mon Sep 17 00:00:00 2001
From 4639be840945f29ba14ed58de8c2f538e2f487fb Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Tue, 5 Oct 2021 21:01:50 -0700
Subject: [PATCH 13/31] Paint: Enable subpixel text positioning by default
Subject: [PATCH 14/34] 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
@@ -24,10 +24,10 @@ Change-Id: I8d71e5848a745c5a2d457a28c68458920928ee09
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/graphics/java/android/graphics/Paint.java b/graphics/java/android/graphics/Paint.java
index d35dcab11f49..e4e814a1c941 100644
index f10cdb82022e..a083c723f9c3 100644
--- a/graphics/java/android/graphics/Paint.java
+++ b/graphics/java/android/graphics/Paint.java
@@ -260,7 +260,7 @@ public class Paint {
@@ -266,7 +266,7 @@ public class Paint {
// These flags are always set on a new/reset paint, even if flags 0 is passed.
static final int HIDDEN_DEFAULT_PAINT_FLAGS = DEV_KERN_TEXT_FLAG | EMBEDDED_BITMAP_TEXT_FLAG

View File

@@ -0,0 +1,28 @@
From 33ea20cb105c85d2c7bc0bab20c5d87ecf2d3df6 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 17 Mar 2024 17:10:38 +0800
Subject: [PATCH 15/34] Remove debuggable requirement for signature spoofing
Change-Id: I8d637ddbbd117a9c5b1d9c5e462b0f4b30d98333
---
services/core/java/com/android/server/pm/ComputerEngine.java | 4 ----
1 file changed, 4 deletions(-)
diff --git a/services/core/java/com/android/server/pm/ComputerEngine.java b/services/core/java/com/android/server/pm/ComputerEngine.java
index d8cbe9d5e7c7..13af78f56462 100644
--- a/services/core/java/com/android/server/pm/ComputerEngine.java
+++ b/services/core/java/com/android/server/pm/ComputerEngine.java
@@ -1472,10 +1472,6 @@ public class ComputerEngine implements Computer {
private static native boolean isDebuggable();
public static boolean isMicrogSigned(AndroidPackage p) {
- if (!isDebuggable()) {
- return false;
- }
-
// Allowlist the following apps:
// * com.android.vending - microG Companion
// * com.google.android.gms - microG Services
--
2.34.1

View File

@@ -0,0 +1,879 @@
From c650743c1e67f48640774af517a2ce77f04e1141 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Thu, 4 Apr 2024 18:26:02 +0800
Subject: [PATCH 16/34] Revert "Update SystemUI to new notification color spec"
This reverts commit db2c5554ac653567d1433d3ff99328c5d855c233.
Change-Id: Iddbe46f4d01d05d6579c1e8b9dab266dd605e199
---
...ication_guts_priority_button_bg_stroke.xml | 5 ++--
.../notification_guts_priority_contents.xml | 5 ++--
.../SystemUI/res/color/remote_input_hint.xml | 5 ++--
.../SystemUI/res/color/remote_input_send.xml | 7 ++---
.../SystemUI/res/color/remote_input_text.xml | 7 ++---
.../drawable/notif_footer_btn_background.xml | 2 +-
.../res/drawable/notification_guts_bg.xml | 2 +-
.../res/drawable/notification_material_bg.xml | 2 +-
.../drawable/remote_input_view_text_bg.xml | 5 ++--
..._notification_section_header_clear_btn.xml | 3 +-
.../SystemUI/res/layout/notif_half_shelf.xml | 3 +-
.../res/layout/notif_half_shelf_row.xml | 5 ++--
.../layout/notification_children_divider.xml | 3 +-
.../layout/notification_conversation_info.xml | 3 +-
.../SystemUI/res/layout/notification_info.xml | 5 ++--
.../res/layout/notification_snooze.xml | 4 +--
.../res/layout/notification_snooze_option.xml | 3 +-
.../layout/status_bar_notification_footer.xml | 6 ++--
...status_bar_notification_section_header.xml | 2 +-
packages/SystemUI/res/values-night/colors.xml | 2 +-
packages/SystemUI/res/values/colors.xml | 2 +-
packages/SystemUI/res/values/styles.xml | 30 ++++---------------
.../systemui/statusbar/EmptyShadeView.java | 8 ++---
.../footer/ui/view/FooterView.java | 29 +++++++++---------
.../row/ActivatableNotificationView.java | 2 +-
.../row/HybridNotificationView.java | 5 ++--
.../row/NotificationConversationInfo.java | 9 +++---
.../row/wrapper/NotificationViewWrapper.java | 3 +-
.../stack/NotificationChildrenContainer.java | 2 +-
.../stack/NotificationSectionsManager.kt | 8 ++---
.../stack/NotificationStackScrollLayout.java | 25 +++++++---------
.../notification/stack/SectionHeaderView.java | 6 ++--
.../statusbar/phone/ScrimController.java | 5 ++--
.../statusbar/phone/TapAgainView.java | 7 ++---
.../statusbar/policy/RemoteInputView.java | 15 +++++-----
.../row/ActivatableNotificationViewTest.kt | 5 ++--
36 files changed, 101 insertions(+), 139 deletions(-)
diff --git a/packages/SystemUI/res/color/notification_guts_priority_button_bg_stroke.xml b/packages/SystemUI/res/color/notification_guts_priority_button_bg_stroke.xml
index d1b8a064724d..015e9f99212d 100644
--- a/packages/SystemUI/res/color/notification_guts_priority_button_bg_stroke.xml
+++ b/packages/SystemUI/res/color/notification_guts_priority_button_bg_stroke.xml
@@ -14,9 +14,8 @@
~ limitations under the License
-->
-<selector xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true"
- android:color="?androidprv:attr/materialColorOnSurfaceVariant" />
+ android:color="?android:attr/colorAccent" />
<item android:color="@color/notification_guts_priority_button_bg_stroke_color" />
</selector>
diff --git a/packages/SystemUI/res/color/notification_guts_priority_contents.xml b/packages/SystemUI/res/color/notification_guts_priority_contents.xml
index cc8c25a2d1ec..42f01896d7a1 100644
--- a/packages/SystemUI/res/color/notification_guts_priority_contents.xml
+++ b/packages/SystemUI/res/color/notification_guts_priority_contents.xml
@@ -14,9 +14,8 @@
~ limitations under the License.
-->
-<selector xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true"
- android:color="?androidprv:attr/materialColorOnSurfaceVariant" />
+ android:color="?android:attr/colorAccent" />
<item android:color="@color/notification_guts_priority_button_content_color" />
</selector>
diff --git a/packages/SystemUI/res/color/remote_input_hint.xml b/packages/SystemUI/res/color/remote_input_hint.xml
index 0d90ee6b47c6..7fe58dbcf822 100644
--- a/packages/SystemUI/res/color/remote_input_hint.xml
+++ b/packages/SystemUI/res/color/remote_input_hint.xml
@@ -14,7 +14,6 @@
~ limitations under the License.
-->
-<selector xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
- <item android:color="?androidprv:attr/materialColorOnSurfaceVariant" android:alpha=".6" />
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:color="?android:attr/textColorPrimary" android:alpha=".6" />
</selector>
\ No newline at end of file
diff --git a/packages/SystemUI/res/color/remote_input_send.xml b/packages/SystemUI/res/color/remote_input_send.xml
index 0acc66b9050f..4dcd3dd229fb 100644
--- a/packages/SystemUI/res/color/remote_input_send.xml
+++ b/packages/SystemUI/res/color/remote_input_send.xml
@@ -15,8 +15,7 @@
~ limitations under the License
-->
-<selector xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
- <item android:state_enabled="false" android:color="?androidprv:attr/materialColorPrimary" android:alpha=".3" />
- <item android:color="?androidprv:attr/materialColorPrimary" />
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_enabled="false" android:color="?android:attr/colorAccent" android:alpha=".3" />
+ <item android:color="?android:attr/colorAccent" />
</selector>
\ No newline at end of file
diff --git a/packages/SystemUI/res/color/remote_input_text.xml b/packages/SystemUI/res/color/remote_input_text.xml
index bf2c198fe540..13bb1d7cbe7d 100644
--- a/packages/SystemUI/res/color/remote_input_text.xml
+++ b/packages/SystemUI/res/color/remote_input_text.xml
@@ -15,8 +15,7 @@
~ limitations under the License
-->
-<selector xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
- <item android:state_enabled="false" android:color="?androidprv:attr/materialColorOnSurfaceVariant" android:alpha=".6" />
- <item android:color="?androidprv:attr/materialColorOnSurfaceVariant" />
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_enabled="false" android:color="?android:attr/textColorPrimary" android:alpha=".6" />
+ <item android:color="?android:attr/textColorPrimary" />
</selector>
\ No newline at end of file
diff --git a/packages/SystemUI/res/drawable/notif_footer_btn_background.xml b/packages/SystemUI/res/drawable/notif_footer_btn_background.xml
index b9597375c3df..e6266754c0af 100644
--- a/packages/SystemUI/res/drawable/notif_footer_btn_background.xml
+++ b/packages/SystemUI/res/drawable/notif_footer_btn_background.xml
@@ -26,7 +26,7 @@
<padding
android:left="20dp"
android:right="20dp" />
- <solid android:color="?androidprv:attr/materialColorSurfaceContainerHigh" />
+ <solid android:color="?androidprv:attr/colorSurface" />
</shape>
</inset>
</item>
diff --git a/packages/SystemUI/res/drawable/notification_guts_bg.xml b/packages/SystemUI/res/drawable/notification_guts_bg.xml
index 84e2231738d4..bd9394bf9f8a 100644
--- a/packages/SystemUI/res/drawable/notification_guts_bg.xml
+++ b/packages/SystemUI/res/drawable/notification_guts_bg.xml
@@ -17,7 +17,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
- <solid android:color="?androidprv:attr/materialColorSurfaceContainerHigh" />
+ <solid android:color="?androidprv:attr/colorSurface" />
<!--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 355e75d0716b..3eaa6180ba1b 100644
--- a/packages/SystemUI/res/drawable/notification_material_bg.xml
+++ b/packages/SystemUI/res/drawable/notification_material_bg.xml
@@ -20,7 +20,7 @@
android:color="?android:attr/colorControlHighlight">
<item>
<shape>
- <solid android:color="?androidprv:attr/materialColorSurfaceContainerHigh" />
+ <solid android:color="?androidprv:attr/colorSurface" />
</shape>
</item>
<item>
diff --git a/packages/SystemUI/res/drawable/remote_input_view_text_bg.xml b/packages/SystemUI/res/drawable/remote_input_view_text_bg.xml
index 45d1a530cd20..535b35497b5c 100644
--- a/packages/SystemUI/res/drawable/remote_input_view_text_bg.xml
+++ b/packages/SystemUI/res/drawable/remote_input_view_text_bg.xml
@@ -14,13 +14,12 @@
~ limitations under the License.
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
android:shape="rectangle">
- <solid android:color="?androidprv:attr/materialColorSurfaceDim" />
+ <solid android:color="?android:attr/colorBackgroundFloating" />
<stroke
android:width="@dimen/remote_input_view_text_stroke"
- android:color="?androidprv:attr/materialColorPrimary"/>
+ android:color="?android:attr/colorAccent"/>
<padding
android:bottom="0dp"
android:left="12dp"
diff --git a/packages/SystemUI/res/drawable/status_bar_notification_section_header_clear_btn.xml b/packages/SystemUI/res/drawable/status_bar_notification_section_header_clear_btn.xml
index 06bed001ae1a..8b3408048848 100644
--- a/packages/SystemUI/res/drawable/status_bar_notification_section_header_clear_btn.xml
+++ b/packages/SystemUI/res/drawable/status_bar_notification_section_header_clear_btn.xml
@@ -15,12 +15,11 @@
limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
android:width="40dp"
android:height="40dp"
android:viewportWidth="40"
android:viewportHeight="40">
<path
- android:fillColor="?androidprv:attr/materialColorOnSurfaceVariant"
+ android:fillColor="@color/notification_section_clear_all_btn_color"
android:pathData="M24.6667 16.2733L23.7267 15.3333L20 19.06L16.2734 15.3333L15.3334 16.2733L19.06 20L15.3334 23.7267L16.2734 24.6667L20 20.94L23.7267 24.6667L24.6667 23.7267L20.94 20L24.6667 16.2733Z"/>
</vector>
diff --git a/packages/SystemUI/res/layout/notif_half_shelf.xml b/packages/SystemUI/res/layout/notif_half_shelf.xml
index 68c8dd96d188..c70f8e2b1c07 100644
--- a/packages/SystemUI/res/layout/notif_half_shelf.xml
+++ b/packages/SystemUI/res/layout/notif_half_shelf.xml
@@ -16,7 +16,6 @@
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
android:id="@+id/half_shelf_dialog"
android:orientation="vertical"
android:layout_width="wrap_content"
@@ -66,7 +65,7 @@
android:gravity="center_vertical|start"
android:ellipsize="end"
android:maxLines="2"
- android:textColor="?androidprv:attr/materialColorOnSurface"
+ android:textColor="?android:attr/textColorPrimary"
android:fontFamily="@*android:string/config_headlineFontFamilyMedium"
android:textSize="16sp"
/>
diff --git a/packages/SystemUI/res/layout/notif_half_shelf_row.xml b/packages/SystemUI/res/layout/notif_half_shelf_row.xml
index 9ef342ce5220..190f9994b1dc 100644
--- a/packages/SystemUI/res/layout/notif_half_shelf_row.xml
+++ b/packages/SystemUI/res/layout/notif_half_shelf_row.xml
@@ -16,7 +16,6 @@
<com.android.systemui.statusbar.notification.row.ChannelRow
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
android:id="@+id/half_shelf_row"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -60,7 +59,7 @@
android:ellipsize="end"
android:maxLines="1"
android:fontFamily="@*android:string/config_headlineFontFamily"
- android:textColor="?androidprv:attr/materialColorOnSurface"
+ android:textColor="?android:attr/textColorPrimary"
android:textSize="16sp"
/>
@@ -75,7 +74,7 @@
android:maxLines="1"
android:layout_below="@id/channel_name"
android:fontFamily="@*android:string/config_bodyFontFamily"
- android:textColor="?androidprv:attr/materialColorOnSurfaceVariant"
+ android:textColor="?android:attr/textColorSecondary"
android:textSize="14sp"
/>
</RelativeLayout>
diff --git a/packages/SystemUI/res/layout/notification_children_divider.xml b/packages/SystemUI/res/layout/notification_children_divider.xml
index 13e24a9ea277..eb743067933d 100644
--- a/packages/SystemUI/res/layout/notification_children_divider.xml
+++ b/packages/SystemUI/res/layout/notification_children_divider.xml
@@ -17,8 +17,7 @@
<com.android.systemui.statusbar.AlphaOptimizedView
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
android:id="@+id/notification_more_divider"
android:layout_width="match_parent"
android:layout_height="@dimen/notification_divider_height"
- android:background="?androidprv:attr/materialColorOnSurfaceVariant" />
+ android:background="@color/notification_divider_color" />
diff --git a/packages/SystemUI/res/layout/notification_conversation_info.xml b/packages/SystemUI/res/layout/notification_conversation_info.xml
index 3a752c81b95a..4f6e88c2266f 100644
--- a/packages/SystemUI/res/layout/notification_conversation_info.xml
+++ b/packages/SystemUI/res/layout/notification_conversation_info.xml
@@ -17,7 +17,6 @@
<com.android.systemui.statusbar.notification.row.NotificationConversationInfo
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
android:id="@+id/notification_guts"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -174,7 +173,7 @@
android:contentDescription="@string/notification_more_settings"
android:background="@drawable/ripple_drawable_20dp"
android:src="@drawable/ic_settings"
- android:tint="?androidprv:attr/materialColorPrimary"
+ android:tint="?android:attr/colorAccent"
android:layout_alignParentEnd="true" />
</LinearLayout>
diff --git a/packages/SystemUI/res/layout/notification_info.xml b/packages/SystemUI/res/layout/notification_info.xml
index 19a3f2fd521c..852db1b8fb91 100644
--- a/packages/SystemUI/res/layout/notification_info.xml
+++ b/packages/SystemUI/res/layout/notification_info.xml
@@ -17,7 +17,6 @@
<com.android.systemui.statusbar.notification.row.NotificationInfo
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
android:id="@+id/notification_guts"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -103,7 +102,7 @@ asked for it -->
android:contentDescription="@string/notification_app_settings"
android:src="@drawable/ic_info"
android:layout_toStartOf="@id/info"
- android:tint="?androidprv:attr/materialColorPrimary"/>
+ android:tint="@color/notification_guts_link_icon_tint"/>
<ImageButton
android:id="@+id/info"
android:layout_width="@dimen/notification_importance_toggle_size"
@@ -112,7 +111,7 @@ asked for it -->
android:contentDescription="@string/notification_more_settings"
android:background="@drawable/ripple_drawable_20dp"
android:src="@drawable/ic_settings"
- android:tint="?androidprv:attr/materialColorPrimary"
+ android:tint="?android:attr/colorAccent"
android:layout_alignParentEnd="true" />
</LinearLayout>
diff --git a/packages/SystemUI/res/layout/notification_snooze.xml b/packages/SystemUI/res/layout/notification_snooze.xml
index 6e541a7a5f32..8b5368098c00 100644
--- a/packages/SystemUI/res/layout/notification_snooze.xml
+++ b/packages/SystemUI/res/layout/notification_snooze.xml
@@ -23,7 +23,7 @@
android:orientation="vertical"
android:paddingTop="2dp"
android:paddingBottom="2dp"
- android:background="?androidprv:attr/materialColorSurfaceContainerHigh"
+ android:background="?androidprv:attr/colorSurface"
android:theme="@style/Theme.SystemUI">
<RelativeLayout
@@ -38,7 +38,7 @@
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:paddingStart="@*android:dimen/notification_content_margin_end"
- android:textColor="?androidprv:attr/materialColorOnSurface"
+ android:textColor="?android:attr/textColorPrimary"
android:paddingEnd="4dp"/>
<ImageView
diff --git a/packages/SystemUI/res/layout/notification_snooze_option.xml b/packages/SystemUI/res/layout/notification_snooze_option.xml
index fa6f965198d4..d42cc0212fd8 100644
--- a/packages/SystemUI/res/layout/notification_snooze_option.xml
+++ b/packages/SystemUI/res/layout/notification_snooze_option.xml
@@ -16,11 +16,10 @@
-->
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
android:layout_width="match_parent"
android:layout_height="@*android:dimen/notification_headerless_min_height"
android:layout_marginStart="@*android:dimen/notification_content_margin_end"
android:layout_marginEnd="@*android:dimen/notification_content_margin_end"
android:gravity="center_vertical"
android:textSize="14sp"
- android:textColor="?androidprv:attr/materialColorOnSurfaceVariant"/>
\ No newline at end of file
+ android:textColor="?android:attr/textColorSecondary"/>
\ No newline at end of file
diff --git a/packages/SystemUI/res/layout/status_bar_notification_footer.xml b/packages/SystemUI/res/layout/status_bar_notification_footer.xml
index 72424a13d0f1..c1bac3151049 100644
--- a/packages/SystemUI/res/layout/status_bar_notification_footer.xml
+++ b/packages/SystemUI/res/layout/status_bar_notification_footer.xml
@@ -41,7 +41,7 @@
android:layout_height="wrap_content"
>
<com.android.systemui.statusbar.notification.row.FooterViewButton
- style="@style/TextAppearance.NotificationFooterButton"
+ style="@style/TextAppearance.NotificationSectionHeaderButton"
android:id="@+id/manage_text"
android:layout_width="wrap_content"
android:layout_height="48dp"
@@ -54,11 +54,12 @@
app:layout_constraintEnd_toStartOf="@id/dismiss_text"
android:background="@drawable/notif_footer_btn_background"
android:focusable="true"
+ android:textColor="@color/notif_pill_text"
android:contentDescription="@string/manage_notifications_history_text"
android:text="@string/manage_notifications_history_text"
/>
<com.android.systemui.statusbar.notification.row.FooterViewButton
- style="@style/TextAppearance.NotificationFooterButton"
+ style="@style/TextAppearance.NotificationSectionHeaderButton"
android:id="@+id/dismiss_text"
android:layout_width="wrap_content"
android:layout_height="48dp"
@@ -69,6 +70,7 @@
app:layout_constraintStart_toEndOf="@id/manage_text"
android:background="@drawable/notif_footer_btn_background"
android:focusable="true"
+ android:textColor="@color/notif_pill_text"
android:contentDescription="@string/accessibility_clear_all"
android:text="@string/clear_all_notifications_text"
/>
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 53abe87e7c12..c4d8d55f74e2 100644
--- a/packages/SystemUI/res/layout/status_bar_notification_section_header.xml
+++ b/packages/SystemUI/res/layout/status_bar_notification_section_header.xml
@@ -40,7 +40,7 @@
android:layout_weight="1">
<TextView
- style="@style/TextAppearance.NotificationSectionHeaderLabel"
+ style="@style/TextAppearance.NotificationSectionHeaderButton"
android:id="@+id/header_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
diff --git a/packages/SystemUI/res/values-night/colors.xml b/packages/SystemUI/res/values-night/colors.xml
index bcc3c83b4560..e759c1211a93 100644
--- a/packages/SystemUI/res/values-night/colors.xml
+++ b/packages/SystemUI/res/values-night/colors.xml
@@ -33,7 +33,7 @@
<!-- The color of the text inside a notification -->
<color name="notification_primary_text_color">@*android:color/notification_primary_text_color_dark</color>
- <color name="notif_pill_text">@android:color/system_on_surface_dark</color>
+ <color name="notif_pill_text">@color/material_dynamic_neutral95</color>
<color name="notification_guts_link_icon_tint">@color/GM2_grey_500</color>
<color name="notification_guts_sub_text_color">@color/GM2_grey_300</color>
diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml
index 34dcd655b8e7..91a72922fd0a 100644
--- a/packages/SystemUI/res/values/colors.xml
+++ b/packages/SystemUI/res/values/colors.xml
@@ -116,7 +116,7 @@
<!-- Chosen so fill over background matches single tone -->
<color name="dark_mode_qs_icon_color_dual_tone_fill">#99000000</color>
- <color name="notif_pill_text">@android:color/system_on_surface_light</color>
+ <color name="notif_pill_text">@color/material_dynamic_neutral10</color>
<!-- Keyboard shortcuts colors -->
<color name="ksh_application_group_color">#fff44336</color>
diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml
index e3d4419afceb..7852608df57d 100644
--- a/packages/SystemUI/res/values/styles.xml
+++ b/packages/SystemUI/res/values/styles.xml
@@ -602,34 +602,34 @@
<style name="TextAppearance.NotificationImportanceChannel">
<item name="android:textSize">@dimen/notification_importance_channel_text</item>
<item name="android:fontFamily">@*android:string/config_headlineFontFamilyMedium</item>
- <item name="android:textColor">?androidprv:attr/materialColorOnSurface</item>
+ <item name="android:textColor">@color/notification_guts_header_text_color</item>
<item name="android:textSize">@dimen/notification_importance_channel_text</item>
</style>
<style name="TextAppearance.NotificationImportanceChannelGroup">
<item name="android:textSize">@dimen/notification_importance_channel_group_text</item>
<item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
- <item name="android:textColor">?androidprv:attr/materialColorOnSurface</item>
+ <item name="android:textColor">@color/notification_guts_header_text_color</item>
<item name="android:textSize">@dimen/notification_importance_channel_group_text</item>
</style>
<style name="TextAppearance.NotificationImportanceApp">
<item name="android:textSize">@dimen/notification_importance_channel_group_text</item>
<item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
- <item name="android:textColor">?androidprv:attr/materialColorOnSurfaceVariant</item>
+ <item name="android:textColor">@color/notification_guts_sub_text_color</item>
<item name="android:textSize">@dimen/notification_importance_channel_group_text</item>
</style>
<style name="TextAppearance.NotificationImportanceHeader">
<item name="android:textSize">@dimen/notification_importance_header_text</item>
<item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
- <item name="android:textColor">?androidprv:attr/materialColorOnSurface</item>
+ <item name="android:textColor">@color/notification_guts_header_text_color</item>
</style>
<style name="TextAppearance.NotificationImportanceDetail">
<item name="android:textSize">@dimen/notification_importance_description_text</item>
<item name="android:fontFamily">@*android:string/config_bodyFontFamily</item>
- <item name="android:textColor">?androidprv:attr/materialColorOnSurfaceVariant</item>
+ <item name="android:textColor">@color/notification_guts_sub_text_color</item>
<item name="android:gravity">center</item>
</style>
@@ -640,28 +640,10 @@
<item name="android:gravity">center</item>
</style>
- <style
- name="TextAppearance.NotificationSectionHeaderLabel"
- parent="@android:style/Widget.DeviceDefault.Button.Borderless">
- <item name="android:textColor">?androidprv:attr/materialColorOnSurface</item>
- <item name="android:textAllCaps">false</item>
- <item name="android:textSize">14sp</item>
- <item name="android:minWidth">0dp</item>
- </style>
-
<style
name="TextAppearance.NotificationSectionHeaderButton"
parent="@android:style/Widget.DeviceDefault.Button.Borderless">
- <item name="android:textColor">?androidprv:attr/materialColorOnSurface</item>
- <item name="android:textAllCaps">false</item>
- <item name="android:textSize">14sp</item>
- <item name="android:minWidth">0dp</item>
- </style>
-
- <style
- name="TextAppearance.NotificationFooterButton"
- parent="@android:style/Widget.DeviceDefault.Button.Borderless">
- <item name="android:textColor">?androidprv:attr/materialColorOnSurface</item>
+ <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/systemui/statusbar/EmptyShadeView.java b/packages/SystemUI/src/com/android/systemui/statusbar/EmptyShadeView.java
index 2338be28d32c..c9758471a30e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/EmptyShadeView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/EmptyShadeView.java
@@ -72,10 +72,10 @@ public class EmptyShadeView extends StackScrollerDecorView {
return findViewById(R.id.no_notifications_footer);
}
- public void setTextColors(@ColorInt int onSurface, @ColorInt int onSurfaceVariant) {
- mEmptyText.setTextColor(onSurfaceVariant);
- mEmptyFooterText.setTextColor(onSurface);
- mEmptyFooterText.setCompoundDrawableTintList(ColorStateList.valueOf(onSurface));
+ public void setTextColor(@ColorInt int color) {
+ mEmptyText.setTextColor(color);
+ mEmptyFooterText.setTextColor(color);
+ mEmptyFooterText.setCompoundDrawableTintList(ColorStateList.valueOf(color));
}
public void setText(@StringRes int text) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/footer/ui/view/FooterView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/footer/ui/view/FooterView.java
index 3616fd6d8cd1..a6e07f1f5e3e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/footer/ui/view/FooterView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/footer/ui/view/FooterView.java
@@ -313,25 +313,26 @@ public class FooterView extends StackScrollerDecorView {
*/
public void updateColors() {
Resources.Theme theme = mContext.getTheme();
- final @ColorInt int onSurface = Utils.getColorAttrDefaultColor(mContext,
- com.android.internal.R.attr.materialColorOnSurface);
+ final @ColorInt int textColor = getResources().getColor(R.color.notif_pill_text, theme);
final Drawable clearAllBg = theme.getDrawable(R.drawable.notif_footer_btn_background);
final Drawable manageBg = theme.getDrawable(R.drawable.notif_footer_btn_background);
- if (!notificationBackgroundTintOptimization()) {
- final @ColorInt int scHigh = Utils.getColorAttrDefaultColor(mContext,
- com.android.internal.R.attr.materialColorSurfaceContainerHigh);
- if (scHigh != 0) {
- final ColorFilter bgColorFilter = new PorterDuffColorFilter(scHigh, SRC_ATOP);
- clearAllBg.setColorFilter(bgColorFilter);
- manageBg.setColorFilter(bgColorFilter);
- }
+ // TODO(b/282173943): Remove redundant tinting once Resources are thread-safe
+ final @ColorInt int buttonBgColor =
+ Utils.getColorAttrDefaultColor(mContext, com.android.internal.R.attr.colorSurface);
+ final ColorFilter bgColorFilter = new PorterDuffColorFilter(buttonBgColor, SRC_ATOP);
+ if (buttonBgColor != 0) {
+ clearAllBg.setColorFilter(bgColorFilter);
+ manageBg.setColorFilter(bgColorFilter);
}
mClearAllButton.setBackground(clearAllBg);
- mClearAllButton.setTextColor(onSurface);
+ mClearAllButton.setTextColor(textColor);
mManageButton.setBackground(manageBg);
- mManageButton.setTextColor(onSurface);
- mSeenNotifsFooterTextView.setTextColor(onSurface);
- mSeenNotifsFooterTextView.setCompoundDrawableTintList(ColorStateList.valueOf(onSurface));
+ mManageButton.setTextColor(textColor);
+ final @ColorInt int labelTextColor =
+ Utils.getColorAttrDefaultColor(mContext, android.R.attr.textColorPrimary);
+ mSeenNotifsFooterTextView.setTextColor(labelTextColor);
+ mSeenNotifsFooterTextView.setCompoundDrawableTintList(
+ ColorStateList.valueOf(labelTextColor));
}
private void updateResources() {
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 4fe05ec9990c..9fa9049cc7cd 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
@@ -124,7 +124,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
private void updateColors() {
mNormalColor = Utils.getColorAttrDefaultColor(mContext,
- com.android.internal.R.attr.materialColorSurfaceContainerHigh);
+ com.android.internal.R.attr.colorSurface);
mTintedRippleColor = mContext.getColor(
R.color.notification_ripple_tinted_color);
mNormalRippleColor = mContext.getColor(
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/HybridNotificationView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/HybridNotificationView.java
index da8c4dc08bf0..892a63505a71 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/HybridNotificationView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/HybridNotificationView.java
@@ -28,6 +28,7 @@ import android.widget.TextView;
import androidx.annotation.ColorInt;
+import com.android.internal.util.ContrastColorUtil;
import com.android.keyguard.AlphaOptimizedLinearLayout;
import com.android.systemui.res.R;
import com.android.systemui.statusbar.CrossFadeHelper;
@@ -97,8 +98,8 @@ public class HybridNotificationView extends AlphaOptimizedLinearLayout
private void resolveThemeTextColors() {
try (TypedArray ta = mContext.getTheme().obtainStyledAttributes(
android.R.style.Theme_DeviceDefault_DayNight, new int[]{
- com.android.internal.R.attr.materialColorOnSurface,
- com.android.internal.R.attr.materialColorOnSurfaceVariant
+ android.R.attr.textColorPrimary,
+ android.R.attr.textColorSecondary
})) {
if (ta != null) {
mPrimaryTextColor = ta.getColor(0, mPrimaryTextColor);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfo.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfo.java
index 14593cb1b381..62b268b90cf3 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfo.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfo.java
@@ -65,10 +65,10 @@ import android.widget.TextView;
import com.android.internal.annotations.VisibleForTesting;
import com.android.settingslib.notification.ConversationIconFactory;
+import com.android.systemui.res.R;
import com.android.systemui.dagger.qualifiers.Background;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.people.widget.PeopleSpaceWidgetManager;
-import com.android.systemui.res.R;
import com.android.systemui.shade.ShadeController;
import com.android.systemui.statusbar.notification.NotificationChannelHelper;
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
@@ -336,11 +336,10 @@ public class NotificationConversationInfo extends LinearLayout implements
Drawable person = mIconFactory.getBaseIconDrawable(mShortcutInfo);
if (person == null) {
person = mContext.getDrawable(R.drawable.ic_person).mutate();
- TypedArray ta = mContext.obtainStyledAttributes(
- new int[]{com.android.internal.R.attr.materialColorPrimary});
- int colorPrimary = ta.getColor(0, 0);
+ TypedArray ta = mContext.obtainStyledAttributes(new int[]{android.R.attr.colorAccent});
+ int colorAccent = ta.getColor(0, 0);
ta.recycle();
- person.setTint(colorPrimary);
+ person.setTint(colorAccent);
}
ImageView image = findViewById(R.id.conversation_icon);
image.setImageDrawable(person);
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 50f3e7896442..6f602ff437eb 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
@@ -337,8 +337,7 @@ public abstract class NotificationViewWrapper implements TransformableView {
if (customBackgroundColor != 0) {
return customBackgroundColor;
}
- return Utils.getColorAttr(mView.getContext(),
- com.android.internal.R.attr.materialColorSurfaceContainerHigh)
+ return Utils.getColorAttr(mView.getContext(), android.R.attr.colorBackground)
.getDefaultColor();
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainer.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainer.java
index 0236fc265add..a929e4f3ea7f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainer.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainer.java
@@ -1362,7 +1362,7 @@ public class NotificationChildrenContainer extends ViewGroup
Resources.Theme theme = new ContextThemeWrapper(mContext,
com.android.internal.R.style.Theme_DeviceDefault_DayNight).getTheme();
try (TypedArray ta = theme.obtainStyledAttributes(
- new int[]{com.android.internal.R.attr.materialColorPrimary})) {
+ new int[]{com.android.internal.R.attr.colorAccent})) {
color = ta.getColor(0, color);
}
mHybridGroupManager.setOverflowNumberColor(mOverflowNumber, color);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSectionsManager.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSectionsManager.kt
index cfc433a09c4d..fd064eeab2ab 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSectionsManager.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSectionsManager.kt
@@ -244,10 +244,10 @@ class NotificationSectionsManager @Inject internal constructor(
}
}
- fun setHeaderForegroundColors(@ColorInt onSurface: Int, @ColorInt onSurfaceVariant: Int) {
- peopleHeaderView?.setForegroundColors(onSurface, onSurfaceVariant)
- silentHeaderView?.setForegroundColors(onSurface, onSurfaceVariant)
- alertingHeaderView?.setForegroundColors(onSurface, onSurfaceVariant)
+ fun setHeaderForegroundColor(@ColorInt color: Int) {
+ peopleHeaderView?.setForegroundColor(color)
+ silentHeaderView?.setForegroundColor(color)
+ alertingHeaderView?.setForegroundColor(color)
}
companion object {
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 3bbdfd164ba7..c84aab1f83cb 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
@@ -341,7 +341,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
private boolean mAnimateNextBackgroundTop;
private boolean mAnimateNextBackgroundBottom;
private boolean mAnimateNextSectionBoundsChange;
- private @ColorInt int mBgColor;
+ private int mBgColor;
private float mDimAmount;
private ValueAnimator mDimAnimator;
private final ArrayList<ExpandableView> mTmpSortedChildren = new ArrayList<>();
@@ -643,8 +643,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
mSections = mSectionsManager.createSectionsForBuckets();
mAmbientState = Dependency.get(AmbientState.class);
- mBgColor = Utils.getColorAttr(mContext,
- com.android.internal.R.attr.materialColorSurfaceContainerHigh).getDefaultColor();
+ mBgColor = Utils.getColorAttr(mContext, android.R.attr.colorBackgroundFloating)
+ .getDefaultColor();
int minHeight = res.getDimensionPixelSize(R.dimen.notification_min_height);
int maxHeight = res.getDimensionPixelSize(R.dimen.notification_max_height);
mSplitShadeMinContentHeight = res.getDimensionPixelSize(
@@ -780,8 +780,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
}
void updateBgColor() {
- mBgColor = Utils.getColorAttr(mContext,
- com.android.internal.R.attr.materialColorSurfaceContainerHigh).getDefaultColor();
+ mBgColor = Utils.getColorAttr(mContext, android.R.attr.colorBackgroundFloating)
+ .getDefaultColor();
updateBackgroundDimming();
for (int i = 0; i < getChildCount(); i++) {
View child = getChildAt(i);
@@ -4473,19 +4473,14 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
}
/**
- * Update colors of section headers, shade footer, and empty shade views.
+ * Update colors of "dismiss" and "empty shade" views.
*/
void updateDecorViews() {
- final @ColorInt int onSurface = Utils.getColorAttrDefaultColor(
- mContext, com.android.internal.R.attr.materialColorOnSurface);
- final @ColorInt int onSurfaceVariant = Utils.getColorAttrDefaultColor(
- mContext, com.android.internal.R.attr.materialColorOnSurfaceVariant);
-
- mSectionsManager.setHeaderForegroundColors(onSurface, onSurfaceVariant);
-
+ final @ColorInt int textColor =
+ Utils.getColorAttrDefaultColor(mContext, android.R.attr.textColorPrimary);
+ mSectionsManager.setHeaderForegroundColor(textColor);
mFooterView.updateColors();
-
- mEmptyShadeView.setTextColors(onSurface, onSurfaceVariant);
+ mEmptyShadeView.setTextColor(textColor);
}
void goToFullShade(long delay) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/SectionHeaderView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/SectionHeaderView.java
index 580431a13d1b..59e1af5eb6f1 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/SectionHeaderView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/SectionHeaderView.java
@@ -132,8 +132,8 @@ public class SectionHeaderView extends StackScrollerDecorView {
mLabelView.setText(resId);
}
- void setForegroundColors(@ColorInt int onSurface, @ColorInt int onSurfaceVariant) {
- mLabelView.setTextColor(onSurface);
- mClearAllButton.setImageTintList(ColorStateList.valueOf(onSurfaceVariant));
+ void setForegroundColor(@ColorInt int color) {
+ mLabelView.setTextColor(color);
+ mClearAllButton.setImageTintList(ColorStateList.valueOf(color));
}
}
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 ae04eaf49b65..05904eae769c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
@@ -1496,9 +1496,8 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
private void updateThemeColors() {
if (mScrimBehind == null) return;
int background = Utils.getColorAttr(mScrimBehind.getContext(),
- com.android.internal.R.attr.materialColorSurfaceDim).getDefaultColor();
- int accent = Utils.getColorAttr(mScrimBehind.getContext(),
- com.android.internal.R.attr.materialColorPrimary).getDefaultColor();
+ android.R.attr.colorBackgroundFloating).getDefaultColor();
+ int accent = Utils.getColorAccent(mScrimBehind.getContext()).getDefaultColor();
mColors.setMainColor(background);
mColors.setSecondaryColor(accent);
final boolean isBackgroundLight = !ContrastColorUtil.isColorDark(background);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/TapAgainView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/TapAgainView.java
index 66ac17eee545..a033e1d55333 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/TapAgainView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/TapAgainView.java
@@ -20,7 +20,6 @@ import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
-import android.annotation.ColorInt;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
@@ -29,7 +28,6 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
-import com.android.settingslib.Utils;
import com.android.systemui.res.R;
import com.android.wm.shell.animation.Interpolators;
@@ -51,9 +49,8 @@ public class TapAgainView extends TextView {
}
void updateColor() {
- final @ColorInt int onSurface = Utils.getColorAttrDefaultColor(mContext,
- com.android.internal.R.attr.materialColorOnSurface);
- setTextColor(onSurface);
+ int textColor = getResources().getColor(R.color.notif_pill_text, mContext.getTheme());
+ setTextColor(textColor);
setBackground(getResources().getDrawable(R.drawable.rounded_bg_full, mContext.getTheme()));
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java
index 4864fb8ca634..ceed81a182aa 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java
@@ -130,7 +130,7 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
private ImageView mDelete;
private ImageView mDeleteBg;
private boolean mColorized;
- private int mLastBackgroundColor;
+ private int mTint;
private boolean mResetting;
@Nullable
private RevealParams mRevealParams;
@@ -181,9 +181,10 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
mEditorActionHandler = new EditorActionHandler();
mUiEventLogger = Dependency.get(UiEventLogger.class);
TypedArray ta = getContext().getTheme().obtainStyledAttributes(new int[]{
- com.android.internal.R.attr.materialColorSurfaceDim,
+ com.android.internal.R.attr.colorAccent,
+ com.android.internal.R.attr.colorSurface,
});
- mLastBackgroundColor = ta.getColor(0, 0);
+ mTint = ta.getColor(0, 0);
ta.recycle();
}
@@ -209,9 +210,9 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
* @param backgroundColor colorized notification color
*/
public void setBackgroundTintColor(final int backgroundColor, boolean colorized) {
- if (colorized == mColorized && backgroundColor == mLastBackgroundColor) return;
+ if (colorized == mColorized && backgroundColor == mTint) return;
mColorized = colorized;
- mLastBackgroundColor = backgroundColor;
+ mTint = backgroundColor;
final int editBgColor;
final int deleteBgColor;
final int deleteFgColor;
@@ -236,8 +237,8 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
hintColor = mContext.getColor(R.color.remote_input_hint);
deleteFgColor = textColor.getDefaultColor();
try (TypedArray ta = getContext().getTheme().obtainStyledAttributes(new int[]{
- com.android.internal.R.attr.materialColorSurfaceDim,
- com.android.internal.R.attr.materialColorSurfaceVariant
+ com.android.internal.R.attr.colorSurfaceHighlight,
+ com.android.internal.R.attr.colorSurfaceVariant
})) {
editBgColor = ta.getColor(0, backgroundColor);
deleteBgColor = ta.getColor(1, Color.GRAY);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationViewTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationViewTest.kt
index 9b9cb8213c91..ccef1d56c6a0 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationViewTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationViewTest.kt
@@ -61,9 +61,8 @@ class ActivatableNotificationViewTest : SysuiTestCase() {
else -> null
} as T?
}
-
- mNormalColor = Utils.getColorAttrDefaultColor(mContext,
- com.android.internal.R.attr.materialColorSurfaceContainerHigh)
+ mNormalColor =
+ Utils.getColorAttrDefaultColor(mContext, com.android.internal.R.attr.colorSurface)
}
@Test
--
2.34.1

View File

@@ -0,0 +1,181 @@
From 456e921e4ea5b79cdf5afbf5207c663d47e1a3b2 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Thu, 4 Apr 2024 18:26:08 +0800
Subject: [PATCH 17/34] Revert "Update framework to new notification color
spec"
This reverts commit 6063e254e0cc84243e3a3fb85fe1bff71b302a87.
---
core/java/android/app/Notification.java | 50 ++++---------------
core/res/res/values/colors.xml | 9 ++--
.../src/android/app/NotificationTest.java | 9 ----
3 files changed, 15 insertions(+), 53 deletions(-)
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index 7454e52b50ef..5d55f3440b57 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -5618,8 +5618,7 @@ public class Notification implements Parcelable
contentView.setInt(R.id.expand_button, "setDefaultPillColor", pillColor);
// Use different highlighted colors for conversations' unread count
if (p.mHighlightExpander) {
- pillColor = Colors.flattenAlpha(
- getColors(p).getTertiaryFixedDimAccentColor(), bgColor);
+ pillColor = Colors.flattenAlpha(getColors(p).getTertiaryAccentColor(), bgColor);
textColor = Colors.flattenAlpha(
getColors(p).getOnTertiaryAccentTextColor(), pillColor);
}
@@ -12782,9 +12781,6 @@ public class Notification implements Parcelable
private int mSecondaryAccentColor = COLOR_INVALID;
private int mTertiaryAccentColor = COLOR_INVALID;
private int mOnTertiaryAccentTextColor = COLOR_INVALID;
- private int mTertiaryFixedDimAccentColor = COLOR_INVALID;
- private int mOnTertiaryFixedAccentTextColor = COLOR_INVALID;
-
private int mErrorColor = COLOR_INVALID;
private int mContrastColor = COLOR_INVALID;
private int mRippleAlpha = 0x33;
@@ -12842,7 +12838,7 @@ public class Notification implements Parcelable
if (isColorized) {
if (rawColor == COLOR_DEFAULT) {
- int[] attrs = {R.attr.materialColorSecondary};
+ int[] attrs = {R.attr.colorAccentSecondary};
try (TypedArray ta = obtainDayNightAttributes(ctx, attrs)) {
mBackgroundColor = getColor(ta, 0, Color.WHITE);
}
@@ -12860,21 +12856,17 @@ public class Notification implements Parcelable
mSecondaryAccentColor = mSecondaryTextColor;
mTertiaryAccentColor = flattenAlpha(mPrimaryTextColor, mBackgroundColor);
mOnTertiaryAccentTextColor = mBackgroundColor;
- mTertiaryFixedDimAccentColor = mTertiaryAccentColor;
- mOnTertiaryFixedAccentTextColor = mOnTertiaryAccentTextColor;
mErrorColor = mPrimaryTextColor;
mRippleAlpha = 0x33;
} else {
int[] attrs = {
- R.attr.materialColorSurfaceContainerHigh,
- R.attr.materialColorOnSurface,
- R.attr.materialColorOnSurfaceVariant,
- R.attr.materialColorPrimary,
- R.attr.materialColorSecondary,
- R.attr.materialColorTertiary,
- R.attr.materialColorOnTertiary,
- R.attr.materialColorTertiaryFixedDim,
- R.attr.materialColorOnTertiaryFixed,
+ R.attr.colorSurface,
+ R.attr.textColorPrimary,
+ R.attr.textColorSecondary,
+ R.attr.colorAccent,
+ R.attr.colorAccentSecondary,
+ R.attr.colorAccentTertiary,
+ R.attr.textColorOnAccent,
R.attr.colorError,
R.attr.colorControlHighlight
};
@@ -12886,10 +12878,8 @@ public class Notification implements Parcelable
mSecondaryAccentColor = getColor(ta, 4, COLOR_INVALID);
mTertiaryAccentColor = getColor(ta, 5, COLOR_INVALID);
mOnTertiaryAccentTextColor = getColor(ta, 6, COLOR_INVALID);
- mTertiaryFixedDimAccentColor = getColor(ta, 7, COLOR_INVALID);
- mOnTertiaryFixedAccentTextColor = getColor(ta, 8, COLOR_INVALID);
- mErrorColor = getColor(ta, 9, COLOR_INVALID);
- mRippleAlpha = Color.alpha(getColor(ta, 10, 0x33ffffff));
+ mErrorColor = getColor(ta, 7, COLOR_INVALID);
+ mRippleAlpha = Color.alpha(getColor(ta, 8, 0x33ffffff));
}
mContrastColor = calculateContrastColor(ctx, rawColor, mPrimaryAccentColor,
mBackgroundColor, nightMode);
@@ -12917,14 +12907,6 @@ public class Notification implements Parcelable
ContrastColorUtil.resolvePrimaryColor(
ctx, mTertiaryAccentColor, nightMode), 0xFF);
}
- if (mTertiaryFixedDimAccentColor == COLOR_INVALID) {
- mTertiaryFixedDimAccentColor = mContrastColor;
- }
- if (mOnTertiaryFixedAccentTextColor == COLOR_INVALID) {
- mOnTertiaryFixedAccentTextColor = ColorUtils.setAlphaComponent(
- ContrastColorUtil.resolvePrimaryColor(
- ctx, mTertiaryFixedDimAccentColor, nightMode), 0xFF);
- }
if (mErrorColor == COLOR_INVALID) {
mErrorColor = mPrimaryTextColor;
}
@@ -12998,16 +12980,6 @@ public class Notification implements Parcelable
return mOnTertiaryAccentTextColor;
}
- /** @return the theme's tertiary fixed dim accent color for colored UI elements. */
- public @ColorInt int getTertiaryFixedDimAccentColor() {
- return mTertiaryFixedDimAccentColor;
- }
-
- /** @return the theme's text color to be used on the tertiary fixed accent color. */
- public @ColorInt int getOnTertiaryFixedAccentTextColor() {
- return mOnTertiaryFixedAccentTextColor;
- }
-
/**
* @return the contrast-adjusted version of the color provided by the app, or the
* primary text color when colorized.
diff --git a/core/res/res/values/colors.xml b/core/res/res/values/colors.xml
index 00cf4243cfa9..2050cfe11d0e 100644
--- a/core/res/res/values/colors.xml
+++ b/core/res/res/values/colors.xml
@@ -135,12 +135,11 @@
<drawable name="notification_template_icon_low_bg">#0cffffff</drawable>
<drawable name="notification_template_divider">#29000000</drawable>
<drawable name="notification_template_divider_media">#29ffffff</drawable>
- <color name="notification_primary_text_color_light">@color/system_on_surface_light</color>
- <color name="notification_primary_text_color_dark">@color/system_on_surface_dark</color>
- <!-- Note that the primary and secondary notification text colors are, in fact, the same. -->
- <color name="notification_secondary_text_color_light">@color/system_on_surface_light</color>
- <color name="notification_secondary_text_color_dark">@color/system_on_surface_dark</color>
+ <color name="notification_primary_text_color_light">@color/primary_text_default_material_light</color>
+ <color name="notification_primary_text_color_dark">@color/primary_text_default_material_dark</color>
+ <color name="notification_secondary_text_color_light">@color/primary_text_default_material_light</color>
<item name="notification_secondary_text_disabled_alpha" format="float" type="dimen">0.38</item>
+ <color name="notification_secondary_text_color_dark">@color/primary_text_default_material_dark</color>
<color name="notification_default_color_dark">#ddffffff</color>
<color name="notification_default_color_light">#a3202124</color>
diff --git a/core/tests/coretests/src/android/app/NotificationTest.java b/core/tests/coretests/src/android/app/NotificationTest.java
index 5b0502da1bdf..297f8254ded1 100644
--- a/core/tests/coretests/src/android/app/NotificationTest.java
+++ b/core/tests/coretests/src/android/app/NotificationTest.java
@@ -859,10 +859,6 @@ public class NotificationTest {
assertEquals(cDay.getTertiaryAccentColor(), cNight.getTertiaryAccentColor());
assertEquals(cDay.getOnTertiaryAccentTextColor(),
cNight.getOnTertiaryAccentTextColor());
- assertEquals(cDay.getTertiaryFixedDimAccentColor(),
- cNight.getTertiaryFixedDimAccentColor());
- assertEquals(cDay.getOnTertiaryFixedAccentTextColor(),
- cNight.getOnTertiaryFixedAccentTextColor());
assertEquals(cDay.getProtectionColor(), cNight.getProtectionColor());
assertEquals(cDay.getContrastColor(), cNight.getContrastColor());
assertEquals(cDay.getRippleAlpha(), cNight.getRippleAlpha());
@@ -1844,8 +1840,6 @@ public class NotificationTest {
assertThat(c.getSecondaryAccentColor()).isNotEqualTo(Notification.COLOR_INVALID);
assertThat(c.getTertiaryAccentColor()).isNotEqualTo(Notification.COLOR_INVALID);
assertThat(c.getOnTertiaryAccentTextColor()).isNotEqualTo(Notification.COLOR_INVALID);
- assertThat(c.getTertiaryFixedDimAccentColor()).isNotEqualTo(Notification.COLOR_INVALID);
- assertThat(c.getOnTertiaryFixedAccentTextColor()).isNotEqualTo(Notification.COLOR_INVALID);
assertThat(c.getErrorColor()).isNotEqualTo(Notification.COLOR_INVALID);
assertThat(c.getContrastColor()).isNotEqualTo(Notification.COLOR_INVALID);
assertThat(c.getRippleAlpha()).isAtLeast(0x00);
@@ -1861,12 +1855,9 @@ public class NotificationTest {
// These colors are only used for emphasized buttons; they do not need contrast
assertContrastIsAtLeast(c.getSecondaryAccentColor(), c.getBackgroundColor(), 1);
assertContrastIsAtLeast(c.getTertiaryAccentColor(), c.getBackgroundColor(), 1);
- assertContrastIsAtLeast(c.getTertiaryFixedDimAccentColor(), c.getBackgroundColor(), 1);
// The text that is used within the accent color DOES need to have contrast
assertContrastIsAtLeast(c.getOnTertiaryAccentTextColor(), c.getTertiaryAccentColor(), 4.5);
- assertContrastIsAtLeast(c.getOnTertiaryFixedAccentTextColor(),
- c.getTertiaryFixedDimAccentColor(), 4.5);
}
private void resolveColorsInNightMode(boolean nightMode, Notification.Colors c, int rawColor,
--
2.34.1

View File

@@ -1,7 +1,7 @@
From 15d6e574126494d166fda1bdfaa22568e0c4aa1c Mon Sep 17 00:00:00 2001
From 35bdcaf6f7a98a68854ac256261d0eb91b1493aa Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Wed, 6 Oct 2021 18:40:30 -0700
Subject: [PATCH 15/31] Revert "Make QS always use dark theme colors"
Subject: [PATCH 18/34] Revert "Make QS always use dark theme colors"
This reverts commit d62f7249f9e3222da95ecf6816601c408aac6be5.
@@ -14,10 +14,10 @@ Change-Id: Iac4c96ccb3845812ca3df820bf27dc533816f72e
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml
index d520670ec012..bd38548dbc65 100644
index 7852608df57d..a3d93d832b38 100644
--- a/packages/SystemUI/res/values/styles.xml
+++ b/packages/SystemUI/res/values/styles.xml
@@ -370,7 +370,7 @@
@@ -389,7 +389,7 @@
<item name="containerStyle">@style/AuthCredentialPinPasswordContainerStyle</item>
</style>

View File

@@ -1,7 +1,7 @@
From 7a570109ab3deea49d6c77e2fd731629e4edabb2 Mon Sep 17 00:00:00 2001
From 2ae2df9278711f93390bede651b69a56099af35b Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Wed, 6 Oct 2021 18:41:11 -0700
Subject: [PATCH 16/31] Revert "Do not re-inflate QS and SB when
Subject: [PATCH 19/34] Revert "Do not re-inflate QS and SB when
CONFIG_UI_MODE"
This reverts commit 8a40ff855b86bc86e23367017002289920855a4e.

View File

@@ -1,7 +1,7 @@
From 48c44b93881a1d839f9906c666a8f40e110bab93 Mon Sep 17 00:00:00 2001
From 5f65456d8135c74d48cd0528fdf7005e235ffd43 Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Mon, 11 Oct 2021 19:24:58 -0700
Subject: [PATCH 17/31] SystemUI: Follow light/dark theme in quick settings
Subject: [PATCH 20/34] 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
@@ -86,10 +86,10 @@ index b6971d3c1fa4..8972df2b7490 100644
<style name="LongScreenshotActivity" parent="@android:style/Theme.DeviceDefault.DayNight">
<item name="android:windowNoTitle">true</item>
diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml
index bd38548dbc65..af92c021ec62 100644
index a3d93d832b38..7ed9f91f30cd 100644
--- a/packages/SystemUI/res/values/styles.xml
+++ b/packages/SystemUI/res/values/styles.xml
@@ -374,7 +374,7 @@
@@ -393,7 +393,7 @@
<item name="isQsTheme">true</item>
<item name="lightIconTheme">@style/QSIconTheme</item>
<item name="darkIconTheme">@style/QSIconTheme</item>
@@ -98,7 +98,7 @@ index bd38548dbc65..af92c021ec62 100644
<item name="android:windowIsFloating">true</item>
<item name="android:homeAsUpIndicator">@drawable/ic_arrow_back</item>
@@ -387,14 +387,14 @@
@@ -406,14 +406,14 @@
<item name="onSurfaceVariant">?androidprv:attr/materialColorOnSurfaceVariant</item>
<item name="outline">?androidprv:attr/materialColorOutline</item>
@@ -121,7 +121,7 @@ index bd38548dbc65..af92c021ec62 100644
<item name="android:itemTextAppearance">@style/Control.MenuItem</item>
</style>
@@ -634,7 +634,7 @@
@@ -663,7 +663,7 @@
<style name="QSCustomizeToolbar" parent="@*android:style/Widget.DeviceDefault.Toolbar">
<item name="android:textColor">?attr/onSurface</item>
@@ -131,10 +131,10 @@ index bd38548dbc65..af92c021ec62 100644
<!-- Media controls always have light background -->
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 b0f8276e460d..fe64f08558f5 100644
index 05904eae769c..1130585db0c7 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
@@ -940,7 +940,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
@@ -945,7 +945,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
mNotificationsAlpha = behindAlpha;
mNotificationsTint = behindTint;
mBehindAlpha = 1;

View File

@@ -1,7 +1,7 @@
From 98ec3af75b139f7bf445d296ededc1e1b2c349d3 Mon Sep 17 00:00:00 2001
From 2ec9f99186510028c1f9d75377a8e65fbc100723 Mon Sep 17 00:00:00 2001
From: Pranav Vashi <neobuddy89@gmail.com>
Date: Wed, 13 Dec 2023 23:24:29 +0530
Subject: [PATCH 18/31] SystemUI: Use themewrapper for QSCustomizer and tune
Subject: [PATCH 21/34] SystemUI: Use themewrapper for QSCustomizer and tune
colorUnavailable
* Restores behvavior from A13 for colorUnavailable, shadeDisabled is now unused.
@@ -13,7 +13,7 @@ Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java b/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java
index 7ef47ab2293a..969bce57699b 100644
index 1af2306ad77d..705d6bb940d6 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java
@@ -23,6 +23,7 @@ import android.content.res.Configuration;
@@ -44,18 +44,18 @@ index 7ef47ab2293a..969bce57699b 100644
toolbar.getMenu().add(Menu.NONE, MENU_RESET, 0, com.android.internal.R.string.reset)
.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
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 764ef681106b..4e59e8c98424 100644
index 456520051f58..3a018c70a8ad 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileViewImpl.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileViewImpl.kt
@@ -95,7 +95,7 @@ open class QSTileViewImpl @JvmOverloads constructor(
@@ -100,7 +100,7 @@ open class QSTileViewImpl @JvmOverloads constructor(
private val colorActive = Utils.getColorAttrDefaultColor(context, R.attr.shadeActive)
private val colorInactive = Utils.getColorAttrDefaultColor(context, R.attr.shadeInactive)
- private val colorUnavailable = Utils.getColorAttrDefaultColor(context, R.attr.shadeDisabled)
+ private val colorUnavailable = Utils.applyAlpha(UNAVAILABLE_ALPHA, colorInactive)
private val colorLabelActive = Utils.getColorAttrDefaultColor(context, R.attr.onShadeActive)
private val colorLabelInactive = Utils.getColorAttrDefaultColor(context, R.attr.onShadeInactive)
private val overlayColorActive = Utils.applyAlpha(
/* alpha= */ 0.11f,
--
2.34.1

View File

@@ -1,7 +1,7 @@
From ff212e50fa84225c115cb7583b22c4bfdd5aac65 Mon Sep 17 00:00:00 2001
From 11a452ed141a31cff8d0ff3c10c28c189a2dffe7 Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Mon, 11 Oct 2021 19:25:02 -0700
Subject: [PATCH 19/31] SystemUI: Initialize QS tiles in inactive state
Subject: [PATCH 22/34] 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
@@ -17,10 +17,10 @@ Change-Id: I048171d503f5533e91bab486b8805ac15c329f31
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 25f77ea4e6d5..7934c5023329 100644
index 5d85fbade873..0c7c46d8d31d 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
@@ -156,7 +156,7 @@ public interface QSTile {
@@ -154,7 +154,7 @@ public interface QSTile {
@ProvidesInterface(version = State.VERSION)
public static class State {
public static final int VERSION = 1;

View File

@@ -1,7 +1,7 @@
From e390498360800b89f064fb96145f204b98dc5dbe Mon Sep 17 00:00:00 2001
From 52d583bc1d9c696bfd4e3cfb12f6b59ec12e3ce4 Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Mon, 11 Oct 2021 19:25:08 -0700
Subject: [PATCH 20/31] SystemUI: Add dual-tone light and dark themes for QS
Subject: [PATCH 23/34] 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,
@@ -80,10 +80,10 @@ index 1571fab66a5b..0683c20a4a4c 100644
<item name="alertDialogTheme">@style/Theme.DeviceDefault.Dialog.Alert</item>
<item name="forceDarkAllowed">false</item>
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 fe64f08558f5..842f3dd8f54c 100644
index 1130585db0c7..b6488cff6842 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
@@ -215,6 +215,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
@@ -219,6 +219,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
private final StatusBarKeyguardViewManager mStatusBarKeyguardViewManager;
private GradientColors mColors;
@@ -91,7 +91,7 @@ index fe64f08558f5..842f3dd8f54c 100644
private boolean mNeedsDrawableColorUpdate;
private float mAdditionalScrimBehindAlphaKeyguard = 0f;
@@ -352,6 +353,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
@@ -359,6 +360,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
mKeyguardTransitionInteractor = keyguardTransitionInteractor;
mWallpaperRepository = wallpaperRepository;
mMainDispatcher = mainDispatcher;
@@ -99,7 +99,7 @@ index fe64f08558f5..842f3dd8f54c 100644
}
@Override
@@ -1127,7 +1129,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
@@ -1132,7 +1134,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
&& !mBlankScreen;
mScrimInFront.setColors(mColors, animateScrimInFront);
@@ -108,7 +108,7 @@ index fe64f08558f5..842f3dd8f54c 100644
mNotificationsScrim.setColors(mColors, animateScrimNotifications);
dispatchBackScrimState(mScrimBehind.getViewAlpha());
@@ -1492,7 +1494,10 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
@@ -1497,7 +1499,10 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
if (mScrimBehind == null) return;
int background = Utils.getColorAttr(mScrimBehind.getContext(),
android.R.attr.colorBackgroundFloating).getDefaultColor();
@@ -119,7 +119,7 @@ index fe64f08558f5..842f3dd8f54c 100644
mColors.setMainColor(background);
mColors.setSecondaryColor(accent);
final boolean isBackgroundLight = !ContrastColorUtil.isColorDark(background);
@@ -1504,6 +1509,11 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
@@ -1509,6 +1514,11 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
state.setSurfaceColor(surface);
}

View File

@@ -1,7 +1,7 @@
From a4b814c2e24e9a5c3bb9d1f50393b207216df6ac Mon Sep 17 00:00:00 2001
From 799c920e75780cf5146f3a3875ce3e84a6df32c1 Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Tue, 8 Mar 2022 20:37:33 -0800
Subject: [PATCH 21/31] SystemUI: Follow light/dark theme in power menu
Subject: [PATCH 24/34] SystemUI: Follow light/dark theme in power menu
Now that we've modified the power menu to refresh on UI mode changes,
make it follow the system light/dark theme for better integration in
@@ -27,7 +27,7 @@ Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
3 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/packages/SystemUI/res/values-night/colors.xml b/packages/SystemUI/res/values-night/colors.xml
index 99311e3d1e1b..6e61294327f7 100644
index e759c1211a93..e98196e800cf 100644
--- a/packages/SystemUI/res/values-night/colors.xml
+++ b/packages/SystemUI/res/values-night/colors.xml
@@ -55,6 +55,11 @@
@@ -43,7 +43,7 @@ index 99311e3d1e1b..6e61294327f7 100644
<color name="global_actions_alert_text">@color/GM2_red_300</color>
diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml
index fed2f9172dc3..b494973b319f 100644
index 91a72922fd0a..0e59b3b774df 100644
--- a/packages/SystemUI/res/values/colors.xml
+++ b/packages/SystemUI/res/values/colors.xml
@@ -36,10 +36,10 @@
@@ -62,10 +62,10 @@ index fed2f9172dc3..b494973b319f 100644
<color name="global_actions_lite_emergency_icon">@color/GM2_grey_900</color>
diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java
index cb8e7c4ca073..3ec6a7cde410 100644
index d94c7bb1c0f8..661e4e6b4b95 100644
--- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java
+++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java
@@ -831,6 +831,15 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene
@@ -842,6 +842,15 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene
user.id) != 0;
}

View File

@@ -1,7 +1,7 @@
From 5bfb64b6e1fe6e78a1b15869332a33c40afde56c Mon Sep 17 00:00:00 2001
From f38638b25fb4dbabf96d5f30ebe3c2e893a39439 Mon Sep 17 00:00:00 2001
From: althafvly <althafvly@gmail.com>
Date: Tue, 26 May 2020 21:17:59 +0800
Subject: [PATCH 22/31] SystemUI: Re-evaluate system theme on UI mode change
Subject: [PATCH 25/34] SystemUI: Re-evaluate system theme on UI mode change
- Need for power menu to set accurate colors
@@ -11,10 +11,10 @@ Change-Id: I05d41eaf8ea19ce3b6ce659d01da33cf55de3b7e
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java b/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java
index 395bb6c6f1af..e27ec424a444 100644
index 8d4e70c2b961..744f1eb67f41 100644
--- a/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java
+++ b/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java
@@ -75,6 +75,8 @@ import com.android.systemui.monet.ColorScheme;
@@ -78,6 +78,8 @@ import com.android.systemui.monet.ColorScheme;
import com.android.systemui.monet.Style;
import com.android.systemui.monet.TonalPalette;
import com.android.systemui.settings.UserTracker;
@@ -22,8 +22,8 @@ index 395bb6c6f1af..e27ec424a444 100644
+import com.android.systemui.statusbar.policy.ConfigurationController.ConfigurationListener;
import com.android.systemui.statusbar.policy.DeviceProvisionedController;
import com.android.systemui.statusbar.policy.DeviceProvisionedController.DeviceProvisionedListener;
import com.android.systemui.util.settings.SecureSettings;
@@ -138,6 +140,7 @@ public class ThemeOverlayController implements CoreStartable, Dumpable {
import com.android.systemui.util.kotlin.JavaAdapter;
@@ -141,6 +143,7 @@ public class ThemeOverlayController implements CoreStartable, Dumpable {
private final boolean mIsMonetEnabled;
private final boolean mIsFidelityEnabled;
private final UserTracker mUserTracker;
@@ -31,7 +31,7 @@ index 395bb6c6f1af..e27ec424a444 100644
private final DeviceProvisionedController mDeviceProvisionedController;
private final Resources mResources;
// Current wallpaper colors associated to a user.
@@ -176,6 +179,15 @@ public class ThemeOverlayController implements CoreStartable, Dumpable {
@@ -181,6 +184,15 @@ public class ThemeOverlayController implements CoreStartable, Dumpable {
// Determines if we should ignore THEME_CUSTOMIZATION_OVERLAY_PACKAGES setting changes.
private boolean mSkipSettingChange;
@@ -47,22 +47,21 @@ index 395bb6c6f1af..e27ec424a444 100644
private final DeviceProvisionedListener mDeviceProvisionedListener =
new DeviceProvisionedListener() {
@Override
@@ -402,11 +414,13 @@ public class ThemeOverlayController implements CoreStartable, Dumpable {
FeatureFlags featureFlags,
@Main Resources resources,
@@ -421,10 +433,12 @@ public class ThemeOverlayController implements CoreStartable, Dumpable {
WakefulnessLifecycle wakefulnessLifecycle,
JavaAdapter javaAdapter,
KeyguardTransitionInteractor keyguardTransitionInteractor,
- UiModeManager uiModeManager) {
+ UiModeManager uiModeManager,
+ ConfigurationController configurationController) {
mContext = context;
mIsMonochromaticEnabled = featureFlags.isEnabled(Flags.MONOCHROMATIC_THEME);
mIsMonetEnabled = featureFlags.isEnabled(Flags.MONET);
mIsFidelityEnabled = featureFlags.isEnabled(Flags.COLOR_FIDELITY);
+ mConfigurationController = configurationController;
mDeviceProvisionedController = deviceProvisionedController;
mBroadcastDispatcher = broadcastDispatcher;
mUserManager = userManager;
@@ -518,6 +532,7 @@ public class ThemeOverlayController implements CoreStartable, Dumpable {
@@ -538,6 +552,7 @@ public class ThemeOverlayController implements CoreStartable, Dumpable {
mUserTracker.addCallback(mUserTrackerCallback, mMainExecutor);

View File

@@ -1,7 +1,7 @@
From 7a6c86c406d9fc8ef0be07caa5d87982402f6d2a Mon Sep 17 00:00:00 2001
From 7b7aab383a7a326b5ae110a2154815c088685d85 Mon Sep 17 00:00:00 2001
From: Danny Baumann <dannybaumann@web.de>
Date: Wed, 20 Jul 2022 15:53:13 +0200
Subject: [PATCH 23/31] SystemUI: Fix QS header clock color
Subject: [PATCH 26/34] SystemUI: Fix QS header clock color
Now that we're flipping QS colors by theme (dark/light), we can no longer
rely on wallpaper colors for QS clock. Instead, we now can rely on clock color
@@ -15,10 +15,10 @@ Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
1 file changed, 8 deletions(-)
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java
index b5b2f0d98733..8664b9c984e5 100644
index cc7a82d49fab..e7d146a5cd5a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java
@@ -42,7 +42,6 @@ import android.text.style.CharacterStyle;
@@ -43,7 +43,6 @@ import android.text.style.CharacterStyle;
import android.text.style.RelativeSizeSpan;
import android.util.AttributeSet;
import android.util.TypedValue;
@@ -26,7 +26,7 @@ index b5b2f0d98733..8664b9c984e5 100644
import android.view.Display;
import android.view.View;
import android.view.ViewGroup;
@@ -432,13 +431,6 @@ public class Clock extends TextView implements
@@ -433,13 +432,6 @@ public class Clock extends TextView implements
setTextColor(mNonAdaptedColor);
}

View File

@@ -1,7 +1,7 @@
From b3ea300144d8d4924754f0516cc2adcb26c7f710 Mon Sep 17 00:00:00 2001
From a4c50a3dbcb4140d93c813be6d128f2d6bf54809 Mon Sep 17 00:00:00 2001
From: Adithya R <gh0strider.2k18.reborn@gmail.com>
Date: Mon, 30 May 2022 00:13:02 +0530
Subject: [PATCH 24/31] SystemUI: Calculate paged QS tiles height properly
Subject: [PATCH 27/34] SystemUI: Calculate paged QS tiles height properly
When QS is re-inflated during UI mode change and we're on the
3rd or higher QS page, the first QS page is misaligned and
@@ -15,10 +15,10 @@ Change-Id: I539babdb75c114cc44b4213ff114d4272be22ef6
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java b/packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java
index 9a5f43b0d6f3..3ec1221f5d01 100644
index 052c0daf0b56..cf2834914f66 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java
@@ -123,12 +123,16 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout {
@@ -135,12 +135,16 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout {
@Override
public int getTilesHeight() {

View File

@@ -1,7 +1,7 @@
From 8d7d5edb443453eac836fd1595bdc67e79164a75 Mon Sep 17 00:00:00 2001
From 6d944c3e413c882c8203bd8eaf2bfc5183fffffd Mon Sep 17 00:00:00 2001
From: althafvly <althafvly@gmail.com>
Date: Tue, 4 Oct 2022 18:34:08 +0530
Subject: [PATCH 25/31] SystemUI: Re-inflate QS and SB when
Subject: [PATCH 28/34] SystemUI: Re-inflate QS and SB when
CONFIG_SCREEN_LAYOUT
- It was removed in a13, needed for light theme change in landscape.

View File

@@ -1,7 +1,7 @@
From cbb3174a2aca29c815b00c840cba3771defa8298 Mon Sep 17 00:00:00 2001
From 901e7a826dcde851f61bd7811eceba2456fb9c25 Mon Sep 17 00:00:00 2001
From: ReallySnow <reallysnow233@gmail.com>
Date: Thu, 15 Sep 2022 13:38:48 +0800
Subject: [PATCH 26/31] SystemUI: Follow light/dark theme in SplitShade Header
Subject: [PATCH 29/34] SystemUI: Follow light/dark theme in SplitShade Header
* Google's default implementation is dark, which means
it doesn't need to follow the light/dark color change,
@@ -11,26 +11,28 @@ Subject: [PATCH 26/31] SystemUI: Follow light/dark theme in SplitShade Header
Co-authored-by: Col_or <col_or@qq.com>
Change-Id: I5464039885197eeb43bd31b822bfcba7a1b08776
---
.../systemui/shade/ShadeHeaderController.kt | 27 +++++++++++++++++++
.../systemui/shade/ShadeHeaderController.kt | 28 +++++++++++++++++++
.../systemui/shade/carrier/ShadeCarrier.java | 8 ++++++
.../shade/carrier/ShadeCarrierGroup.java | 16 +++++++++++
3 files changed, 51 insertions(+)
.../shade/ShadeHeaderControllerTest.kt | 1 +
4 files changed, 53 insertions(+)
diff --git a/packages/SystemUI/src/com/android/systemui/shade/ShadeHeaderController.kt b/packages/SystemUI/src/com/android/systemui/shade/ShadeHeaderController.kt
index 3c08389a7ca2..5cdd6f44d4a0 100644
index 593260996198..5a5cb792c10b 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/ShadeHeaderController.kt
+++ b/packages/SystemUI/src/com/android/systemui/shade/ShadeHeaderController.kt
@@ -22,7 +22,10 @@ import android.annotation.IdRes
@@ -21,8 +21,11 @@ import android.animation.AnimatorListenerAdapter
import android.annotation.IdRes
import android.app.PendingIntent
import android.app.StatusBarManager
import android.content.Intent
+import android.content.Context
import android.content.Intent
+import android.content.res.ColorStateList
import android.content.res.Configuration
+import android.graphics.Color
import android.graphics.Insets
import android.os.Bundle
import android.os.Trace
import android.os.Trace.TRACE_TAG_APP
@@ -91,6 +94,7 @@ constructor(
private val privacyIconsController: HeaderPrivacyIconsController,
private val insetsProvider: StatusBarContentInsetsProvider,
@@ -39,7 +41,7 @@ index 3c08389a7ca2..5cdd6f44d4a0 100644
private val variableDateViewControllerFactory: VariableDateViewController.Factory,
@Named(SHADE_HEADER) private val batteryMeterViewController: BatteryMeterViewController,
private val dumpManager: DumpManager,
@@ -141,6 +145,7 @@ constructor(
@@ -142,6 +146,7 @@ constructor(
private var cutout: DisplayCutout? = null
private var lastInsets: WindowInsets? = null
private var nextAlarmIntent: PendingIntent? = null
@@ -47,7 +49,7 @@ index 3c08389a7ca2..5cdd6f44d4a0 100644
private var qsDisabled = false
private var visible = false
@@ -283,6 +288,10 @@ constructor(
@@ -288,6 +293,10 @@ constructor(
updateCarrierGroupPadding()
clock.onDensityOrFontScaleChanged()
}
@@ -58,21 +60,19 @@ index 3c08389a7ca2..5cdd6f44d4a0 100644
}
private val nextAlarmCallback =
@@ -335,6 +344,7 @@ constructor(
@@ -341,6 +350,7 @@ constructor(
demoModeController.addCallback(demoModeReceiver)
statusBarIconController.addIconGroup(iconManager)
nextAlarmController.addCallback(nextAlarmCallback)
+ updateResources()
systemIcons.setOnHoverListener(
statusOverlayHoverListenerFactory.createListener(systemIcons)
systemIconsHoverContainer.setOnHoverListener(
statusOverlayHoverListenerFactory.createListener(systemIconsHoverContainer)
)
@@ -538,6 +548,23 @@ constructor(
@@ -544,6 +554,24 @@ constructor(
header.setPadding(padding, header.paddingTop, padding, header.paddingBottom)
updateQQSPaddings()
qsBatteryModeController.updateResources()
+
+ val fillColor = Utils.getColorAttrDefaultColor(context, android.R.attr.textColorPrimary)
+ iconManager.setTint(fillColor)
+ val textColor = Utils.getColorAttrDefaultColor(context, android.R.attr.textColorPrimary)
+ val colorStateList = Utils.getColorAttr(context, android.R.attr.textColorPrimary)
+ if (textColor != textColorPrimary) {
@@ -80,7 +80,10 @@ index 3c08389a7ca2..5cdd6f44d4a0 100644
+ android.R.attr.textColorSecondary)
+ textColorPrimary = textColor
+ if (iconManager != null) {
+ iconManager.setTint(textColor)
+ iconManager.setTint(
+ textColorPrimary,
+ Utils.getColorAttrDefaultColor(context, android.R.attr.textColorPrimaryInverse),
+ )
+ }
+ clock.setTextColor(textColorPrimary)
+ date.setTextColor(textColorPrimary)
@@ -91,7 +94,7 @@ index 3c08389a7ca2..5cdd6f44d4a0 100644
private fun updateQQSPaddings() {
diff --git a/packages/SystemUI/src/com/android/systemui/shade/carrier/ShadeCarrier.java b/packages/SystemUI/src/com/android/systemui/shade/carrier/ShadeCarrier.java
index 8612cdf12c6e..5940677c4842 100644
index 6ca0ad47a0a7..24a1e7cda1fd 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/carrier/ShadeCarrier.java
+++ b/packages/SystemUI/src/com/android/systemui/shade/carrier/ShadeCarrier.java
@@ -152,6 +152,14 @@ public class ShadeCarrier extends LinearLayout {
@@ -110,7 +113,7 @@ index 8612cdf12c6e..5940677c4842 100644
View getRSSIView() {
return mMobileGroup;
diff --git a/packages/SystemUI/src/com/android/systemui/shade/carrier/ShadeCarrierGroup.java b/packages/SystemUI/src/com/android/systemui/shade/carrier/ShadeCarrierGroup.java
index 68561d1cfd0f..97964c38a92f 100644
index e84fb485829c..a5bcfeacff31 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/carrier/ShadeCarrierGroup.java
+++ b/packages/SystemUI/src/com/android/systemui/shade/carrier/ShadeCarrierGroup.java
@@ -18,8 +18,11 @@ package com.android.systemui.shade.carrier;
@@ -145,6 +148,18 @@ index 68561d1cfd0f..97964c38a92f 100644
public void updateTextAppearance(@StyleRes int resId) {
FontSizeUtils.updateFontSizeFromStyle(getNoSimTextView(), resId);
getCarrier1View().updateTextAppearance(resId);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/ShadeHeaderControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/shade/ShadeHeaderControllerTest.kt
index 9fa173ab040a..de321ba62105 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/shade/ShadeHeaderControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/shade/ShadeHeaderControllerTest.kt
@@ -189,6 +189,7 @@ class ShadeHeaderControllerTest : SysuiTestCase() {
privacyIconsController,
insetsProvider,
configurationController,
+ mockedContext,
variableDateViewControllerFactory,
batteryMeterViewController,
dumpManager,
--
2.34.1

View File

@@ -1,7 +1,7 @@
From 8fc39e71d3601ff02b1da15b8db234e4e8952045 Mon Sep 17 00:00:00 2001
From 740f1c7ff7d0a429e79d5bf075c162314ca6fd66 Mon Sep 17 00:00:00 2001
From: Adithya R <gh0strider.2k18.reborn@gmail.com>
Date: Thu, 19 Jan 2023 14:37:43 +0530
Subject: [PATCH 27/31] SystemUI: Remove visibility check in setting QSCarrier
Subject: [PATCH 30/34] SystemUI: Remove visibility check in setting QSCarrier
color
This fixes a corner case where the signal icon color is incorrect:
@@ -19,7 +19,7 @@ Change-Id: I092c06053fc4bc8d9ca51d1d31128da27ef6a823
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/packages/SystemUI/src/com/android/systemui/shade/carrier/ShadeCarrier.java b/packages/SystemUI/src/com/android/systemui/shade/carrier/ShadeCarrier.java
index 5940677c4842..fef896579bbf 100644
index 24a1e7cda1fd..727a187d20f7 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/carrier/ShadeCarrier.java
+++ b/packages/SystemUI/src/com/android/systemui/shade/carrier/ShadeCarrier.java
@@ -153,11 +153,8 @@ public class ShadeCarrier extends LinearLayout {

View File

@@ -1,7 +1,7 @@
From ee07d3b1026400a4aac3743d8fb6feff5242c5ac Mon Sep 17 00:00:00 2001
From b983f9062624d76c6cf6a66eee0851bb99e83c3d Mon Sep 17 00:00:00 2001
From: DillerOFire <niktofe1@gmail.com>
Date: Wed, 27 Jul 2022 15:28:16 +1000
Subject: [PATCH 28/31] SystemUI: Switch notification background to monet on
Subject: [PATCH 31/34] SystemUI: Switch notification background to monet on
heads up
Change-Id: If1822acc3ea604444f2083d7fadec06ffb8eec19
@@ -47,10 +47,10 @@ index 000000000000..61a8e8e9c6e1
+</ripple>
\ No newline at end of file
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 1b790fdc35c1..e958cbf452db 100644
index 9fa9049cc7cd..dc04895508d0 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
@@ -168,7 +168,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
@@ -171,7 +171,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
* be useful in a configuration change.
*/
protected void initBackground() {
@@ -59,7 +59,7 @@ index 1b790fdc35c1..e958cbf452db 100644
}
protected boolean hideBackground() {
@@ -179,6 +179,13 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
@@ -182,6 +182,13 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
mBackgroundNormal.setVisibility(hideBackground() ? INVISIBLE : VISIBLE);
}
@@ -74,10 +74,10 @@ index 1b790fdc35c1..e958cbf452db 100644
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java
index d92d11b18d74..ce9eac753550 100644
index b6d4dedfe6f7..2ea46cae819f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java
@@ -1047,6 +1047,9 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
@@ -1041,6 +1041,9 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
if (intrinsicHeight != getIntrinsicHeight()) {
notifyHeightChanged(false /* needsAnimation */);
}

View File

@@ -1,7 +1,7 @@
From 84c5455182edb1703ba9cb0c209eb66c636fec6b Mon Sep 17 00:00:00 2001
From ab0a1b7775420943aae88747a3c79893e934e672 Mon Sep 17 00:00:00 2001
From: Pulkit077 <pulkitagarwal2k1@gmail.com>
Date: Fri, 16 Sep 2022 14:46:37 +0530
Subject: [PATCH 29/31] SystemUI: Follow Dark/Light theme for Safe Mode dialog
Subject: [PATCH 32/34] SystemUI: Follow Dark/Light theme for Safe Mode dialog
Change-Id: Ia9864a45551e969abaccd351e8b6d65e21d99165
Signed-off-by: Pulkit077 <pulkitagarwal2k1@gmail.com>
@@ -11,18 +11,18 @@ Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/services/core/java/com/android/server/power/ShutdownThread.java b/services/core/java/com/android/server/power/ShutdownThread.java
index 3630ae26fbc2..98a37d0a8e96 100644
index c919dcbad45b..cb3c30b3fef1 100644
--- a/services/core/java/com/android/server/power/ShutdownThread.java
+++ b/services/core/java/com/android/server/power/ShutdownThread.java
@@ -30,6 +30,7 @@ import android.content.IIntentReceiver;
@@ -31,6 +31,7 @@ import android.content.IIntentReceiver;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageManagerInternal;
+import android.content.res.Configuration;
import android.media.AudioAttributes;
import android.os.Bundle;
import android.os.FileUtils;
@@ -185,6 +186,11 @@ public final class ShutdownThread extends Thread {
import android.os.Handler;
@@ -194,6 +195,11 @@ public final class ShutdownThread extends Thread {
? com.android.internal.R.string.shutdown_confirm_question
: com.android.internal.R.string.shutdown_confirm);
@@ -34,7 +34,7 @@ index 3630ae26fbc2..98a37d0a8e96 100644
if (DEBUG) {
Log.d(TAG, "Notifying thread to start shutdown longPressBehavior=" + longPressBehavior);
}
@@ -194,7 +200,7 @@ public final class ShutdownThread extends Thread {
@@ -203,7 +209,7 @@ public final class ShutdownThread extends Thread {
if (sConfirmDialog != null) {
sConfirmDialog.dismiss();
}

View File

@@ -1,7 +1,7 @@
From a4b5ee62c8b2e49ce188631cb9155cef5c2dd143 Mon Sep 17 00:00:00 2001
From 43b40366ed1feb86002b849851678baeed250d47 Mon Sep 17 00:00:00 2001
From: minaripenguin <minaripenguin@users.noreply.github.com>
Date: Fri, 24 Mar 2023 13:04:06 +0800
Subject: [PATCH 30/31] SystemUI: Follow monet theme on privacy indicators
Subject: [PATCH 33/34] SystemUI: Follow monet theme on privacy indicators
Change-Id: Ib713cb3283fcf3a49086c5da8360d2a1b6cd6704
Signed-off-by: minaripenguin <minaripenguin@users.noreply.github.com>
@@ -12,10 +12,10 @@ Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml
index b494973b319f..d65f5d66c5e4 100644
index 0e59b3b774df..8a02dca04251 100644
--- a/packages/SystemUI/res/values/colors.xml
+++ b/packages/SystemUI/res/values/colors.xml
@@ -217,7 +217,7 @@
@@ -216,7 +216,7 @@
<color name="screenrecord_status_color">#E94235</color>
<color name="screenrecord_icon_color">#D93025</color><!-- red 600 -->
@@ -25,7 +25,7 @@ index b494973b319f..d65f5d66c5e4 100644
<!-- Accessibility floating menu -->
<color name="accessibility_floating_menu_background">#CCFFFFFF</color> <!-- 80% -->
diff --git a/packages/SystemUI/src/com/android/systemui/privacy/OngoingPrivacyChip.kt b/packages/SystemUI/src/com/android/systemui/privacy/OngoingPrivacyChip.kt
index 310d23407d5d..957fc8faad2c 100644
index 8e1b00d825aa..a79a10639b9d 100644
--- a/packages/SystemUI/src/com/android/systemui/privacy/OngoingPrivacyChip.kt
+++ b/packages/SystemUI/src/com/android/systemui/privacy/OngoingPrivacyChip.kt
@@ -123,7 +123,7 @@ class OngoingPrivacyChip @JvmOverloads constructor(

View File

@@ -1,15 +1,15 @@
From c84b629202ee60515734b3798e5914cda8a6424b Mon Sep 17 00:00:00 2001
From 83a1b45cc8d1d6d4f5d8d275db29fc7ed3f34cff Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Wed, 10 Jan 2024 23:36:41 +0800
Subject: [PATCH 31/31] SystemUI: Follow monet theme on battery chip
Subject: [PATCH 34/34] SystemUI: Follow monet theme on battery chip
Why does this chip even exist...
Change-Id: I178fdda5d8d310c4c7fa5f05f9911b3f94986cb9
---
packages/SystemUI/res/drawable/statusbar_chip_bg.xml | 8 +++-----
.../com/android/systemui/statusbar/BatteryStatusChip.kt | 4 ++--
2 files changed, 5 insertions(+), 7 deletions(-)
.../com/android/systemui/statusbar/BatteryStatusChip.kt | 6 ++++++
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/packages/SystemUI/res/drawable/statusbar_chip_bg.xml b/packages/SystemUI/res/drawable/statusbar_chip_bg.xml
index d7de16d7c5bb..dd1db04e77d7 100644
@@ -30,21 +30,29 @@ index d7de16d7c5bb..dd1db04e77d7 100644
\ No newline at end of file
+</shape>
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BatteryStatusChip.kt b/packages/SystemUI/src/com/android/systemui/statusbar/BatteryStatusChip.kt
index 520976746785..e22a599ed80e 100644
index 835225009110..04373eb7ed87 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/BatteryStatusChip.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/BatteryStatusChip.kt
@@ -64,9 +64,9 @@ class BatteryStatusChip @JvmOverloads constructor(context: Context, attrs: Attri
@@ -22,6 +22,7 @@ import android.util.AttributeSet
import android.view.View
import android.widget.FrameLayout
import android.widget.LinearLayout
+import com.android.settingslib.Utils
import com.android.systemui.battery.BatteryMeterView
import com.android.systemui.res.R
import com.android.systemui.statusbar.events.BackgroundAnimatableView
@@ -65,6 +66,11 @@ class BatteryStatusChip @JvmOverloads constructor(context: Context, attrs: Attri
@SuppressLint("UseCompatLoadingForDrawables")
private fun updateResources() {
val primaryColor =
- Utils.getColorAttrDefaultColor(context, com.android.internal.R.attr.colorPrimary)
+ val primaryColor =
+ Utils.getColorAttrDefaultColor(context, android.R.attr.textColorPrimaryInverse)
val textColorSecondary =
- Utils.getColorAttrDefaultColor(mContext, android.R.attr.textColorSecondary)
+ val textColorSecondary =
+ Utils.getColorAttrDefaultColor(mContext, android.R.attr.textColorSecondaryInverse)
batteryMeterView.updateColors(primaryColor, textColorSecondary, primaryColor)
+ batteryMeterView.updateColors(primaryColor, textColorSecondary, primaryColor)
roundedContainer.background = mContext.getDrawable(R.drawable.statusbar_chip_bg)
}
}
--
2.34.1