Changes for March 2023

This commit is contained in:
Andy CrossGate Yan 2023-03-22 10:36:39 +00:00
parent 4bc5076d1c
commit 7c52a16c2e
61 changed files with 1424 additions and 755 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/patches_treble_personal/vendor_hardware_overlay

View File

@ -1,7 +1,7 @@
From f0314afe5afcd4bf19188c8688a35e322a7bcf44 Mon Sep 17 00:00:00 2001
From 107b0eaf96413e3faac0bcbe7e761d98d3595d76 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Thu, 13 Jan 2022 14:22:24 +0000
Subject: [PATCH 01/15] Add SPenPointerOverlay
Subject: [PATCH 01/24] Add SPenPointerOverlay
Toggle this overlay with property "persist.ui.spen.pointer"
@ -122,5 +122,5 @@ index 000000000000..f35255c5f961
+ android:hotSpotX="5dp"
+ android:hotSpotY="5dp" />
--
2.25.1
2.34.1

View File

@ -1,7 +1,7 @@
From bdb1e544a11d7c82366c636d49da988c8ce6a218 Mon Sep 17 00:00:00 2001
From c37fef3e91e035f05f3a9a6ab2f744f6e2051b38 Mon Sep 17 00:00:00 2001
From: AndyCGYan <GeForce8800Ultra@gmail.com>
Date: Fri, 22 Mar 2019 00:41:20 +0800
Subject: [PATCH 02/15] Disable FP lockouts optionally
Subject: [PATCH 02/24] Disable FP lockouts optionally
Both timed and permanent lockouts - GET THE FUCK OUT
Now targeting LockoutFramework, introduced in Android 12
@ -72,5 +72,5 @@ index a0befea8e085..48c4ded9f5ca 100644
return LOCKOUT_NONE;
}
--
2.25.1
2.34.1

View File

@ -1,7 +1,7 @@
From 1b1a877dc08bf8177192b4c44644eecac9469721 Mon Sep 17 00:00:00 2001
From c51f1b93e9e69cd50959a7d5b8936adabbb98b8c 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 03/15] Disable vendor mismatch warning
Subject: [PATCH 03/24] Disable vendor mismatch warning
Change-Id: Ieb8fe91e2f02462f074312ed0f4885d183e9780b
---
@ -9,10 +9,10 @@ Change-Id: Ieb8fe91e2f02462f074312ed0f4885d183e9780b
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
index 01490f029e97..6199267cac0b 100644
index 3e1b30b2ff25..8681bd726f3b 100644
--- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
+++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
@@ -5856,20 +5856,8 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
@@ -5859,20 +5859,8 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
}
if (!Build.isBuildConsistent()) {
@ -36,5 +36,5 @@ index 01490f029e97..6199267cac0b 100644
}
}
--
2.25.1
2.34.1

View File

@ -1,7 +1,7 @@
From 25a596aa94e3e050e5c7726bf3cfa35f8f0492ac Mon Sep 17 00:00:00 2001
From 53944713b59f662f2a19ea3ccd3cfdcec9f3593a 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/15] Keyguard: Fix colors of slices not updating on doze
Subject: [PATCH 04/24] 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 c715a4eaef2b..a16ab6b8283a 100644
index aec30632c41e..7ef624a6f184 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java
@@ -93,6 +93,13 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV
@@ -99,6 +99,13 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV
mKeyguardSliceViewController.refresh();
}
@ -31,10 +31,10 @@ index c715a4eaef2b..a16ab6b8283a 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 f371aac2090a..e6c4fcfefde0 100644
index 731ce92099e8..3e748a0f2722 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
@@ -4758,6 +4758,7 @@ public final class NotificationPanelViewController extends PanelViewController {
@@ -5718,6 +5718,7 @@ public final class NotificationPanelViewController implements Dumpable {
public void onDozeAmountChanged(float linearAmount, float amount) {
mInterpolatedDarkAmount = amount;
mLinearDarkAmount = linearAmount;
@ -43,5 +43,5 @@ index f371aac2090a..e6c4fcfefde0 100644
}
}
--
2.25.1
2.34.1

View File

@ -1,7 +1,7 @@
From e5dd5a8c1d88fdc155c7ef05aafb148773e40ae7 Mon Sep 17 00:00:00 2001
From d7612a2bd79c4fbc738bfb4cee56a3a88839d415 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/15] UI: Adjust default navbar layouts
Subject: [PATCH 05/24] UI: Adjust default navbar layouts
- Slightly tighten nodpi layout
- Remove sw372dp layout - looks terrible, probably meant for legacy phablets, but most modern phones qualify
@ -45,7 +45,7 @@ index 07b797a32428..000000000000
- <string name="config_navBarLayout" translatable="false">left[.25W],back[.5WC];home;recent[.5WC],right[.25W]</string>
-</resources>
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index d7d88cea2dbc..8a2b88d3cf9a 100644
index 48c35ae8789d..70269b18a573 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -301,7 +301,7 @@
@ -58,5 +58,5 @@ index d7d88cea2dbc..8a2b88d3cf9a 100644
<string name="config_navBarLayoutHandle" translatable="false">back[70AC];home_handle;ime_switcher[70AC]</string>
--
2.25.1
2.34.1

View File

@ -1,7 +1,7 @@
From d95f2986ab877e2f33ce45fea6e4997ff17a35e1 Mon Sep 17 00:00:00 2001
From 132cfec6f7d245e867a2be7939931076d721405d 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 06/15] UI: Disable wallpaper zoom
Subject: [PATCH 06/24] 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 659d0f37bf05..272df37188bf 100644
index 987426f56463..c2e2c91b2829 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -5104,7 +5104,7 @@
@@ -5146,7 +5146,7 @@
<item name="config_wallpaperMinScale" format="float" type="dimen">1</item>
<!-- The max scale for the wallpaper when it's zoomed in -->
@ -24,5 +24,5 @@ index 659d0f37bf05..272df37188bf 100644
<!-- If true, the wallpaper will scale regardless of the value of shouldZoomOutWallpaper() -->
<bool name="config_alwaysScaleWallpaper">false</bool>
--
2.25.1
2.34.1

View File

@ -1,7 +1,7 @@
From 3495203480c06150d56ffd11513f0dc0cfffa9dc Mon Sep 17 00:00:00 2001
From 3cea896b28374cb5975b470134bf572e004c5329 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 07/15] UI: Follow Monet and light/dark theme in user 1 icon
Subject: [PATCH 07/24] UI: Follow Monet and light/dark theme in user 1 icon
Change-Id: I755077c6003c39ddc9428da1defe6a6ddd0e5ff8
---
@ -35,5 +35,5 @@ index d5875f547e91..c7711ed3e493 100644
<color name="user_icon_3">#ff4c8df6</color><!-- blue -->
<color name="user_icon_4">#fff439a0</color><!-- pink -->
--
2.25.1
2.34.1

View File

@ -1,7 +1,7 @@
From 953d205e2408dcd0f7fe25e7c2801512fad196fd Mon Sep 17 00:00:00 2001
From 9999d9887ec0fc9f3227bac752126d98b2adc07e 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 08/15] UI: Increase default status bar height
Subject: [PATCH 08/24] UI: Increase default status bar height
Change-Id: Ibbcf63159e19bb2bb2b1094ea07ab85917630b07
---
@ -31,5 +31,5 @@ index 2542268a153a..099a6badc034 100644
Do not read this dimen directly. Use {@link SystemBarUtils#getStatusBarHeight} instead.
-->
--
2.25.1
2.34.1

View File

@ -1,32 +1,25 @@
From 29b987ef4e37748102b41aeabf6a6fb810e6c37e Mon Sep 17 00:00:00 2001
From b85e925a3accec749a28d5edd6bff3ce20f68924 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 09/15] UI: Remove QS footer background
Subject: [PATCH 09/24] UI: Remove QS footer background
Change-Id: I68e82e0c5e3eddb2d3f767fe792b1436eae506ef
---
packages/SystemUI/res-keyguard/layout/footer_actions.xml | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
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 a101c64a48e0..028ab29b8643 100644
index 544d0299060d..d45744961f59 100644
--- a/packages/SystemUI/res-keyguard/layout/footer_actions.xml
+++ b/packages/SystemUI/res-keyguard/layout/footer_actions.xml
@@ -25,7 +25,6 @@
@@ -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"
>
@@ -98,4 +97,4 @@
android:tint="?androidprv:attr/textColorPrimaryInverse" />
</LinearLayout>
-</com.android.systemui.qs.FooterActionsView>
\ No newline at end of file
+</com.android.systemui.qs.FooterActionsView>
/>
--
2.25.1
2.34.1

View File

@ -1,16 +1,16 @@
From f37c5b2151383a120c728d02439692f55c90334e Mon Sep 17 00:00:00 2001
From 289c535bf6f0decf2c1ce58650ec7dd6721880a8 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 10/15] UI: Restore split-screen divider to pre-Sv2 looks
Subject: [PATCH 10/24] UI: Restore split-screen divider to pre-Sv2 looks
- Kill rounded corners - where two rectangles collide should be perfectly straight
- Make it black again - taskbar should mind its own business
Change-Id: I240b627793b615c82bd07ebd77638cde180ef80f
---
.../Shell/res/color/split_divider_background.xml | 4 ++--
.../wm/shell/common/split/SplitLayout.java | 15 +--------------
2 files changed, 3 insertions(+), 16 deletions(-)
.../res/color/split_divider_background.xml | 4 ++--
.../wm/shell/common/split/SplitLayout.java | 19 ++-----------------
2 files changed, 4 insertions(+), 19 deletions(-)
diff --git a/libs/WindowManager/Shell/res/color/split_divider_background.xml b/libs/WindowManager/Shell/res/color/split_divider_background.xml
index 049980803ee3..cd54ac26a7fd 100644
@ -26,16 +26,17 @@ index 049980803ee3..cd54ac26a7fd 100644
+ <item android:color="@android:color/black" />
+</selector>
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 419e62daf586..229844e42a49 100644
index 45b234a6398a..f0b1ff3999bc 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
@@ -152,20 +152,7 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange
@@ -153,23 +153,8 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange
}
private int getDividerInsets(Resources resources, Display display) {
private void updateDividerConfig(Context context) {
- final Resources resources = context.getResources();
- final Display display = context.getDisplay();
- final int dividerInset = resources.getDimensionPixelSize(
- com.android.internal.R.dimen.docked_stack_divider_insets);
-
- int radius = 0;
- RoundedCorner corner = display.getRoundedCorner(RoundedCorner.POSITION_TOP_LEFT);
- radius = corner != null ? Math.max(radius, corner.getRadius()) : radius;
@ -46,11 +47,14 @@ index 419e62daf586..229844e42a49 100644
- corner = display.getRoundedCorner(RoundedCorner.POSITION_BOTTOM_LEFT);
- radius = corner != null ? Math.max(radius, corner.getRadius()) : radius;
-
- return Math.max(dividerInset, radius);
+ return 0;
- mDividerInsets = Math.max(dividerInset, radius);
- mDividerSize = resources.getDimensionPixelSize(R.dimen.split_divider_bar_width);
- mDividerWindowWidth = mDividerSize + 2 * mDividerInsets;
+ mDividerWindowWidth = context.getResources().getDimensionPixelSize(
+ R.dimen.split_divider_bar_width);
}
/** Gets bounds of the primary split with screen based coordinate. */
--
2.25.1
2.34.1

View File

@ -1,7 +1,7 @@
From 9d7f2acaa960dd74aa0bc030c3e6d9cd5a234a74 Mon Sep 17 00:00:00 2001
From 0697f6baa9ffb4f69b90e9c4f8469e7bd130d6bc 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/15] UI: Revive navbar layout tuning via sysui_nav_bar
Subject: [PATCH 11/24] UI: Revive navbar layout tuning via sysui_nav_bar
tunable
Google keeps fixing what ain't broken.
@ -60,5 +60,5 @@ index 51feed875337..5f0f9a220c31 100644
final String newValue = getDefaultLayout();
if (!Objects.equals(mCurrentLayout, newValue)) {
--
2.25.1
2.34.1

View File

@ -1,7 +1,7 @@
From f5e22a9b6f467439f4c84ee6afbcbcdbbb45b3da Mon Sep 17 00:00:00 2001
From 9f0fb3f042124da5731232dffa1bda623c395a22 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 12/15] UI: Use SNAP_FIXED_RATIO for multi-window globally
Subject: [PATCH 12/24] 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 272df37188bf..58cd819b9404 100644
index c2e2c91b2829..8f81427cbe67 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -3790,7 +3790,7 @@
@@ -3829,7 +3829,7 @@
1 - 3 snap targets: fixed ratio, 1:1, (1 - fixed ratio)
2 - 1 snap target: 1:1
-->
@ -91,5 +91,5 @@ index 272df37188bf..58cd819b9404 100644
<!-- The maximum aspect ratio (longerSide/shorterSide) that is treated as close-to-square. The
orientation requests from apps would be ignored if the display is close-to-square. -->
--
2.25.1
2.34.1

View File

@ -1,7 +1,7 @@
From c29a4e448651024369665a67a9938592f727394a Mon Sep 17 00:00:00 2001
From 30a3637fe457193166cc324af29c306d7748adfa Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Tue, 3 Nov 2020 22:43:12 -0800
Subject: [PATCH 13/15] core: Remove old app target SDK dialog
Subject: [PATCH 13/24] 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
@ -27,5 +27,5 @@ index 994f07959f3b..6749ae78c09c 100644
/**
--
2.25.1
2.34.1

View File

@ -1,7 +1,7 @@
From feca2661444f0d615f8c050fed4d79acffb42890 Mon Sep 17 00:00:00 2001
From 964346e2b9e8ceaa7c6b2b9a4c74a401af0fc9e0 Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Tue, 5 Oct 2021 21:01:50 -0700
Subject: [PATCH 14/15] Paint: Enable subpixel text positioning by default
Subject: [PATCH 14/24] 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 451b99ea7550..e60d506a171b 100644
index f438a03b1434..6621d1f23166 100644
--- a/graphics/java/android/graphics/Paint.java
+++ b/graphics/java/android/graphics/Paint.java
@@ -253,7 +253,7 @@ public class Paint {
@@ -260,7 +260,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
@ -37,5 +37,5 @@ index 451b99ea7550..e60d506a171b 100644
/**
* Font hinter option that disables font hinting.
--
2.25.1
2.34.1

View File

@ -0,0 +1,320 @@
From 4fa320b2eacab5be5b9fb3f2ebe24f39e8b54cc1 Mon Sep 17 00:00:00 2001
From: Park Ju Hyung <qkrwngud825@gmail.com>
Date: Sun, 15 Jan 2017 03:33:04 +0900
Subject: [PATCH 15/24] SystemUI: add burnIn protection
Devices with AMOLED display suffer from
status-bar's notification items and nagivation bar's software keys
causing permanent burn-ins when used long-term.
Moving all items in the area
both horizontally and vertically workarounds this problem.
jrizzoli: integrate with runtime cmsdk preference
Linux4: Removed toggle from settings - the burnIn protection is always
enabled if the corresponding AOSP overlay is set to true
Updated for T
Change-Id: I35b04d1edff86a556adb3ad349569e5d82653f16
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: Alex Naidis <alex.naidis@linux.com>
Signed-off-by: Thecrazyskull <anaskarbila@gmail.com>
Signed-off-by: Joey Rizzoli <joey@lineageos.org>
---
.../SystemUI/res/values/lineage_dimens.xml | 3 +
.../navigationbar/NavigationBarView.java | 26 +++++
.../statusbar/phone/CentralSurfacesImpl.java | 14 +++
.../statusbar/phone/PhoneStatusBarView.java | 27 +++++
.../policy/BurnInProtectionController.java | 105 ++++++++++++++++++
5 files changed, 175 insertions(+)
create mode 100644 packages/SystemUI/src/com/android/systemui/statusbar/policy/BurnInProtectionController.java
diff --git a/packages/SystemUI/res/values/lineage_dimens.xml b/packages/SystemUI/res/values/lineage_dimens.xml
index e1998ce3d3ab..dc59ccd794f7 100644
--- a/packages/SystemUI/res/values/lineage_dimens.xml
+++ b/packages/SystemUI/res/values/lineage_dimens.xml
@@ -21,4 +21,7 @@
<!-- Largest size an avatar might need to be drawn in the power menu user picker -->
<dimen name="global_actions_avatar_size">24dp</dimen>
+
+ <dimen name="burnin_protection_horizontal_shift">3dp</dimen>
+ <dimen name="burnin_protection_vertical_shift">1dp</dimen>
</resources>
diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java
index 883903efb95f..2020910d88bf 100644
--- a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java
@@ -163,6 +163,13 @@ public class NavigationBarView extends FrameLayout implements TunerService.Tunab
private FloatingRotationButton mFloatingRotationButton;
private RotationButtonController mRotationButtonController;
+ private int mBasePaddingBottom;
+ private int mBasePaddingLeft;
+ private int mBasePaddingRight;
+ private int mBasePaddingTop;
+
+ private ViewGroup mNavigationBarContents;
+
/**
* Helper that is responsible for showing the right toast when a disallowed activity operation
* occurred. In pinned mode, we show instructions on how to break out of this mode, whilst in
@@ -880,12 +887,31 @@ public class NavigationBarView extends FrameLayout implements TunerService.Tunab
mContextualButtonGroup.setButtonVisibility(R.id.accessibility_button, visible);
}
+ public void shiftNavigationBarItems(int horizontalShift, int verticalShift) {
+ if (mNavigationBarContents == null) {
+ return;
+ }
+
+ mNavigationBarContents.setPaddingRelative(mBasePaddingLeft + horizontalShift,
+ mBasePaddingTop + verticalShift,
+ mBasePaddingRight + horizontalShift,
+ mBasePaddingBottom - verticalShift);
+ invalidate();
+ }
+
@Override
public void onFinishInflate() {
super.onFinishInflate();
mNavigationInflaterView = findViewById(R.id.navigation_inflater);
mNavigationInflaterView.setButtonDispatchers(mButtonDispatchers);
+
+ mNavigationBarContents = (ViewGroup) findViewById(R.id.nav_buttons);
+
+ mBasePaddingLeft = mNavigationBarContents.getPaddingStart();
+ mBasePaddingTop = mNavigationBarContents.getPaddingTop();
+ mBasePaddingRight = mNavigationBarContents.getPaddingEnd();
+ mBasePaddingBottom = mNavigationBarContents.getPaddingBottom();
updateOrientationViews();
reloadNavIcons();
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
index 83755c6591be..4e2bb5424eb8 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
@@ -226,6 +226,7 @@ import com.android.systemui.statusbar.phone.dagger.StatusBarPhoneModule;
import com.android.systemui.statusbar.phone.ongoingcall.OngoingCallController;
import com.android.systemui.statusbar.policy.BatteryController;
import com.android.systemui.statusbar.policy.BrightnessMirrorController;
+import com.android.systemui.statusbar.policy.BurnInProtectionController;
import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.statusbar.policy.ConfigurationController.ConfigurationListener;
import com.android.systemui.statusbar.policy.DeviceProvisionedController;
@@ -453,6 +454,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces, Tune
@Nullable
protected LockscreenWallpaper mLockscreenWallpaper;
private final AutoHideController mAutoHideController;
+ private BurnInProtectionController mBurnInProtectionController;
private final Point mCurrentDisplaySize = new Point();
@@ -1233,6 +1235,12 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces, Tune
mNotificationPanelViewController.updatePanelExpansionAndVisibility();
setBouncerShowingForStatusBarComponents(mBouncerShowing);
checkBarModes();
+
+ if (mContext.getResources().getBoolean(
+ com.android.internal.R.bool.config_enableBurnInProtection)) {
+ mBurnInProtectionController = new BurnInProtectionController(mContext,
+ this, mStatusBarView);
+ }
});
initializer.initializeStatusBar(mCentralSurfacesComponent);
@@ -3488,6 +3496,9 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces, Tune
updateNotificationPanelTouchState();
mNotificationShadeWindowViewController.cancelCurrentTouch();
+ if (mBurnInProtectionController != null) {
+ mBurnInProtectionController.stopShiftTimer(true);
+ }
if (mLaunchCameraOnFinishedGoingToSleep) {
mLaunchCameraOnFinishedGoingToSleep = false;
@@ -3593,6 +3604,9 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces, Tune
}
}
updateScrimController();
+ if (mBurnInProtectionController != null) {
+ mBurnInProtectionController.startShiftTimer(true);
+ }
}
};
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
index 5692024fb473..3892921957b2 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
@@ -19,6 +19,7 @@ package com.android.systemui.statusbar.phone;
import android.annotation.Nullable;
import android.content.Context;
+import android.content.res.Resources;
import android.content.res.Configuration;
import android.graphics.Rect;
import android.inputmethodservice.InputMethodService;
@@ -63,6 +64,13 @@ public class PhoneStatusBarView extends FrameLayout implements Callbacks {
private final CommandQueue mCommandQueue;
private final StatusBarContentInsetsProvider mContentInsetsProvider;
+ private int mBasePaddingBottom;
+ private int mBasePaddingLeft;
+ private int mBasePaddingRight;
+ private int mBasePaddingTop;
+
+ private ViewGroup mStatusBarContents;
+
private DarkReceiver mBattery;
private ClockController mClockController;
private int mRotationOrientation = -1;
@@ -140,6 +148,18 @@ public class PhoneStatusBarView extends FrameLayout implements Callbacks {
StatusBarUserChipViewBinder.bind(container, viewModel);
}
+ public void shiftStatusBarItems(int horizontalShift, int verticalShift) {
+ if (mStatusBarContents == null) {
+ return;
+ }
+
+ mStatusBarContents.setPaddingRelative(mBasePaddingLeft + horizontalShift,
+ mBasePaddingTop + verticalShift,
+ mBasePaddingRight + horizontalShift,
+ mBasePaddingBottom - verticalShift);
+ invalidate();
+ }
+
@Override
public void onFinishInflate() {
super.onFinishInflate();
@@ -147,6 +167,13 @@ public class PhoneStatusBarView extends FrameLayout implements Callbacks {
mClockController = new ClockController(getContext(), this);
mCutoutSpace = findViewById(R.id.cutout_space_view);
+ mStatusBarContents = (ViewGroup) findViewById(R.id.status_bar_contents);
+
+ mBasePaddingLeft = mStatusBarContents.getPaddingStart();
+ mBasePaddingTop = mStatusBarContents.getPaddingTop();
+ mBasePaddingRight = mStatusBarContents.getPaddingEnd();
+ mBasePaddingBottom = mStatusBarContents.getPaddingBottom();
+
updateResources();
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BurnInProtectionController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BurnInProtectionController.java
new file mode 100644
index 000000000000..864d86ffd6a3
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BurnInProtectionController.java
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2017 Paranoid Android
+ * Copyright 2020 The LineageOS Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.statusbar.policy;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.os.Handler;
+import android.os.Looper;
+import android.util.Log;
+
+import com.android.systemui.R;
+import com.android.systemui.navigationbar.NavigationBarView;
+import com.android.systemui.statusbar.phone.PhoneStatusBarView;
+import com.android.systemui.statusbar.phone.CentralSurfacesImpl;
+
+public class BurnInProtectionController {
+ private static final String TAG = "BurnInProtectionController";
+ private static final boolean DEBUG = false;
+ private static final long INTERVAL = 60000; // Milliseconds
+
+ private int mHorizontalShift = 0;
+ private int mVerticalShift = 0;
+ private int mHorizontalDirection = 1;
+ private int mVerticalDirection = 1;
+ private int mNavigationBarHorizontalMaxShift;
+ private int mNavigationBarVerticalMaxShift;
+ private int mHorizontalMaxShift;
+ private int mVerticalMaxShift;
+ private long mShiftInterval;
+
+ private final Handler mHandler = new Handler();
+ private final Runnable mRunnable = () -> {
+ shiftItems();
+ mHandler.postDelayed(this.mRunnable, INTERVAL);
+ };
+
+ private PhoneStatusBarView mPhoneStatusBarView;
+ private CentralSurfacesImpl mStatusBar;
+
+ private Context mContext;
+
+ public BurnInProtectionController(Context context, CentralSurfacesImpl statusBar,
+ PhoneStatusBarView phoneStatusBarView) {
+ mContext = context;
+
+ mPhoneStatusBarView = phoneStatusBarView;
+ mStatusBar = statusBar;
+
+ mHorizontalMaxShift = mContext.getResources()
+ .getDimensionPixelSize(R.dimen.burnin_protection_horizontal_shift);
+ // total of ((vertical_max_shift - 1) * 2) pixels can be moved
+ mVerticalMaxShift = mContext.getResources()
+ .getDimensionPixelSize(R.dimen.burnin_protection_vertical_shift) - 1;
+ }
+
+ public void startShiftTimer(boolean enabled) {
+ if (!enabled) return;
+ mHandler.removeCallbacks(mRunnable);
+ mHandler.postDelayed(mRunnable, INTERVAL);
+ if (DEBUG) Log.d(TAG, "Started shift timer");
+ }
+
+ public void stopShiftTimer(boolean enabled) {
+ if (!enabled) return;
+ mHandler.removeCallbacks(mRunnable);
+ if (DEBUG) Log.d(TAG, "Canceled shift timer");
+ }
+
+ private void shiftItems() {
+ mHorizontalShift += mHorizontalDirection;
+ if ((mHorizontalShift >= mHorizontalMaxShift) ||
+ (mHorizontalShift <= -mHorizontalMaxShift)) {
+ mHorizontalDirection *= -1;
+ }
+
+ mVerticalShift += mVerticalDirection;
+ if ((mVerticalShift >= mVerticalMaxShift) ||
+ (mVerticalShift <= -mVerticalMaxShift)) {
+ mVerticalDirection *= -1;
+ }
+
+ mPhoneStatusBarView.shiftStatusBarItems(mHorizontalShift, mVerticalShift);
+ NavigationBarView navigationBarView = mStatusBar.getNavigationBarView();
+
+ if (navigationBarView != null) {
+ navigationBarView.shiftNavigationBarItems(mHorizontalShift, mVerticalShift);
+ }
+ if (DEBUG) Log.d(TAG, "Shifting items\u2026");
+ }
+}
--
2.34.1

View File

@ -1,7 +1,7 @@
From 933a1e4767cc3deec8545623ce7e44f39a05a922 Mon Sep 17 00:00:00 2001
From d5b5deb95a8bf6737973cde8460d05b19a70032c Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Sat, 16 Oct 2021 05:27:57 -0700
Subject: [PATCH 15/15] Add support for app signature spoofing
Subject: [PATCH 16/24] 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
@ -38,7 +38,7 @@ Change-Id: Ied7d6ce0b83a2d2345c3abba0429998d86494a88
4 files changed, 56 insertions(+), 3 deletions(-)
diff --git a/core/api/current.txt b/core/api/current.txt
index c8a43db2f9c2..277183036c60 100644
index 487e57d114c9..04e69741b9fd 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -87,6 +87,7 @@ package android {
@ -58,10 +58,10 @@ index c8a43db2f9c2..277183036c60 100644
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 1b90803404f7..d1cb6c3241f2 100644
index bbe31240f5f3..7d717b2106a1 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -3542,6 +3542,21 @@
@@ -3572,6 +3572,21 @@
android:description="@string/permdesc_getPackageSize"
android:protectionLevel="normal" />
@ -84,10 +84,10 @@ index 1b90803404f7..d1cb6c3241f2 100644
{@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 5763345aba4d..8ffdbdd6f15b 100644
index 9410e0682106..7ed7a03f1b61 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -974,6 +974,18 @@
@@ -977,6 +977,18 @@
<!-- Permissions -->
@ -159,5 +159,5 @@ index 46b7460dff1b..40549962436f 100644
if (packageInfo == null) {
return null;
--
2.25.1
2.34.1

View File

@ -0,0 +1,113 @@
From 47265639ead98824ac0d176e06bcffe6a2035a42 Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Mon, 11 Oct 2021 19:59:51 -0700
Subject: [PATCH 17/24] Spoof product name for Google Play Services
NB: This code is under the gmscompat package, but it does not depend on
any code from gmscompat.
Change-Id: Ic018c0d7abe4573143c3b92301a2625b91e6673a
---
core/java/android/app/Instrumentation.java | 4 ++
.../internal/gmscompat/AttestationHooks.java | 60 +++++++++++++++++++
2 files changed, 64 insertions(+)
create mode 100644 core/java/com/android/internal/gmscompat/AttestationHooks.java
diff --git a/core/java/android/app/Instrumentation.java b/core/java/android/app/Instrumentation.java
index 556058b567f9..44449588bbab 100644
--- a/core/java/android/app/Instrumentation.java
+++ b/core/java/android/app/Instrumentation.java
@@ -57,6 +57,8 @@ import android.view.WindowManagerGlobal;
import com.android.internal.content.ReferrerIntent;
+import com.android.internal.gmscompat.AttestationHooks;
+
import java.io.File;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -1242,6 +1244,7 @@ public class Instrumentation {
Application app = getFactory(context.getPackageName())
.instantiateApplication(cl, className);
app.attach(context);
+ AttestationHooks.initApplicationBeforeOnCreate(app);
return app;
}
@@ -1259,6 +1262,7 @@ public class Instrumentation {
ClassNotFoundException {
Application app = (Application)clazz.newInstance();
app.attach(context);
+ AttestationHooks.initApplicationBeforeOnCreate(app);
return app;
}
diff --git a/core/java/com/android/internal/gmscompat/AttestationHooks.java b/core/java/com/android/internal/gmscompat/AttestationHooks.java
new file mode 100644
index 000000000000..55db97dc28a1
--- /dev/null
+++ b/core/java/com/android/internal/gmscompat/AttestationHooks.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.internal.gmscompat;
+
+import android.app.Application;
+import android.os.Build;
+import android.os.SystemProperties;
+import android.util.Log;
+
+import java.lang.reflect.Field;
+
+/** @hide */
+public final class AttestationHooks {
+ private static final String TAG = "GmsCompat/Attestation";
+
+ private static final String PACKAGE_GMS = "com.google.android.gms";
+
+ private AttestationHooks() { }
+
+ private static void setBuildField(String key, String value) {
+ try {
+ // Unlock
+ Field field = Build.class.getDeclaredField(key);
+ field.setAccessible(true);
+
+ // Edit
+ field.set(null, value);
+
+ // Lock
+ field.setAccessible(false);
+ } catch (NoSuchFieldException | IllegalAccessException e) {
+ Log.e(TAG, "Failed to spoof Build." + key, e);
+ }
+ }
+
+ private static void spoofBuildGms() {
+ // Alter model name to avoid hardware attestation enforcement
+ setBuildField("MODEL", "Pixel 5a");
+ }
+
+ public static void initApplicationBeforeOnCreate(Application app) {
+ if (PACKAGE_GMS.equals(app.getPackageName())) {
+ spoofBuildGms();
+ }
+ }
+}
--
2.34.1

View File

@ -0,0 +1,93 @@
From 838a9febd980da5a1829c75f86ecc5a519e9cdb9 Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Mon, 11 Oct 2021 20:00:44 -0700
Subject: [PATCH 18/24] keystore: Block key attestation for SafetyNet
SafetyNet (part of Google Play Services) opportunistically uses
hardware-backed key attestation via KeyStore as a strong integrity
check. This causes SafetyNet to fail on custom ROMs because the verified
boot key and bootloader unlock state can be detected from attestation
certificates.
As a workaround, we can take advantage of the fact that SafetyNet's
usage of key attestation is opportunistic (i.e. falls back to basic
integrity checks if it fails) and prevent it from getting the
attestation certificate chain from KeyStore. This is done by checking
the stack for DroidGuard, which is the codename for SafetyNet, and
pretending that the device doesn't support key attestation.
Key attestation has only been blocked for SafetyNet specifically, as
Google Play Services and other apps have many valid reasons to use it.
For example, it appears to be involved in Google's mobile security key
ferature.
Change-Id: I5146439d47f42dc6231cb45c4dab9f61540056f6
---
.../internal/gmscompat/AttestationHooks.java | 15 +++++++++++++++
.../security/keystore2/AndroidKeyStoreSpi.java | 3 +++
2 files changed, 18 insertions(+)
diff --git a/core/java/com/android/internal/gmscompat/AttestationHooks.java b/core/java/com/android/internal/gmscompat/AttestationHooks.java
index 55db97dc28a1..f2c85c82821f 100644
--- a/core/java/com/android/internal/gmscompat/AttestationHooks.java
+++ b/core/java/com/android/internal/gmscompat/AttestationHooks.java
@@ -22,12 +22,14 @@ import android.os.SystemProperties;
import android.util.Log;
import java.lang.reflect.Field;
+import java.util.Arrays;
/** @hide */
public final class AttestationHooks {
private static final String TAG = "GmsCompat/Attestation";
private static final String PACKAGE_GMS = "com.google.android.gms";
+ private static volatile boolean sIsGms = false;
private AttestationHooks() { }
@@ -54,7 +56,20 @@ public final class AttestationHooks {
public static void initApplicationBeforeOnCreate(Application app) {
if (PACKAGE_GMS.equals(app.getPackageName())) {
+ sIsGms = true;
spoofBuildGms();
}
}
+
+ private static boolean isCallerSafetyNet() {
+ return Arrays.stream(Thread.currentThread().getStackTrace())
+ .anyMatch(elem -> elem.getClassName().contains("DroidGuard"));
+ }
+
+ public static void onEngineGetCertificateChain() {
+ // Check stack for SafetyNet
+ if (sIsGms && isCallerSafetyNet()) {
+ throw new UnsupportedOperationException();
+ }
+ }
}
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreSpi.java b/keystore/java/android/security/keystore2/AndroidKeyStoreSpi.java
index 33411e1ec5b9..133a4094d434 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreSpi.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreSpi.java
@@ -42,6 +42,7 @@ import android.system.keystore2.ResponseCode;
import android.util.Log;
import com.android.internal.annotations.VisibleForTesting;
+import com.android.internal.gmscompat.AttestationHooks;
import java.io.ByteArrayInputStream;
import java.io.IOException;
@@ -164,6 +165,8 @@ public class AndroidKeyStoreSpi extends KeyStoreSpi {
@Override
public Certificate[] engineGetCertificateChain(String alias) {
+ AttestationHooks.onEngineGetCertificateChain();
+
KeyEntryResponse response = getKeyMetadata(alias);
if (response == null || response.metadata.certificate == null) {
--
2.34.1

View File

@ -0,0 +1,42 @@
From 260b0f7a81c762b3b03b8f83dedee9c92e0f55ca Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Mon, 1 Nov 2021 20:06:48 -0700
Subject: [PATCH 19/24] Limit SafetyNet workarounds to unstable GMS process
The unstable process is where SafetyNet attestation actually runs, so
we only need to spoof the model in that process. Leaving other processes
fixes various issues caused by model detection and flag provisioning,
including screen-off Voice Match in Google Assistant, broken At a Glance
weather and settings on Android 12, and more.
Change-Id: Idcf663907a6c3d0408dbd45b1ac53c9eb4200df8
---
.../com/android/internal/gmscompat/AttestationHooks.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/core/java/com/android/internal/gmscompat/AttestationHooks.java b/core/java/com/android/internal/gmscompat/AttestationHooks.java
index f2c85c82821f..37ce8c946de6 100644
--- a/core/java/com/android/internal/gmscompat/AttestationHooks.java
+++ b/core/java/com/android/internal/gmscompat/AttestationHooks.java
@@ -29,6 +29,8 @@ public final class AttestationHooks {
private static final String TAG = "GmsCompat/Attestation";
private static final String PACKAGE_GMS = "com.google.android.gms";
+ private static final String PROCESS_UNSTABLE = "com.google.android.gms.unstable";
+
private static volatile boolean sIsGms = false;
private AttestationHooks() { }
@@ -55,7 +57,8 @@ public final class AttestationHooks {
}
public static void initApplicationBeforeOnCreate(Application app) {
- if (PACKAGE_GMS.equals(app.getPackageName())) {
+ if (PACKAGE_GMS.equals(app.getPackageName()) &&
+ PROCESS_UNSTABLE.equals(Application.getProcessName())) {
sIsGms = true;
spoofBuildGms();
}
--
2.34.1

View File

@ -0,0 +1,59 @@
From 839d9d8e213a15c823aa218539993b2c23f3bd65 Mon Sep 17 00:00:00 2001
From: Dyneteve <dyneteve@hentaios.com>
Date: Tue, 23 Aug 2022 18:57:05 +0200
Subject: [PATCH 20/24] gmscompat: Apply the SafetyNet workaround to Play Store
aswell
Play Store is used for the new Play Integrity API, extend the hack
to it aswell
Test: Device Integrity and Basic Integrity passes.
Signed-off-by: Dyneteve <dyneteve@hentaios.com>
Change-Id: Id607cdff0b902f285a6c1b769c0a4ee4202842b1
---
.../android/internal/gmscompat/AttestationHooks.java | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/core/java/com/android/internal/gmscompat/AttestationHooks.java b/core/java/com/android/internal/gmscompat/AttestationHooks.java
index 37ce8c946de6..65469239a0c6 100644
--- a/core/java/com/android/internal/gmscompat/AttestationHooks.java
+++ b/core/java/com/android/internal/gmscompat/AttestationHooks.java
@@ -29,9 +29,11 @@ public final class AttestationHooks {
private static final String TAG = "GmsCompat/Attestation";
private static final String PACKAGE_GMS = "com.google.android.gms";
+ private static final String PACKAGE_FINSKY = "com.android.vending";
private static final String PROCESS_UNSTABLE = "com.google.android.gms.unstable";
private static volatile boolean sIsGms = false;
+ private static volatile boolean sIsFinsky = false;
private AttestationHooks() { }
@@ -62,6 +64,11 @@ public final class AttestationHooks {
sIsGms = true;
spoofBuildGms();
}
+
+ if (PACKAGE_FINSKY.equals(app.getPackageName())) {
+ sIsFinsky = true;
+ spoofBuildGms();
+ }
}
private static boolean isCallerSafetyNet() {
@@ -74,5 +81,10 @@ public final class AttestationHooks {
if (sIsGms && isCallerSafetyNet()) {
throw new UnsupportedOperationException();
}
+
+ // Check stack for PlayIntegrity
+ if (sIsFinsky) {
+ throw new UnsupportedOperationException();
+ }
}
}
--
2.34.1

View File

@ -0,0 +1,46 @@
From 030dc8f051ca98594cc037b1fe6b79d417d3a8a3 Mon Sep 17 00:00:00 2001
From: Dyneteve <dyneteve@hentaios.com>
Date: Thu, 8 Sep 2022 14:39:52 +0200
Subject: [PATCH 21/24] gmscompat: Use Nexus 6P fingerprint for CTS/Integrity
Google seems to have patched the KM block to Play Store in record time,
but is still not enforced for anything under android N.
Since we moved to angler FP we don't need to spoof model to Play Store
anymore, however the KM block is still needed.
Test: Run Play Intregrity Attestation
Signed-off-by: Dyneteve <dyneteve@hentaios.com>
Change-Id: Ic2401a6e40ddfc4318a1d0faa87e42eb118ac3d1
---
.../com/android/internal/gmscompat/AttestationHooks.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/core/java/com/android/internal/gmscompat/AttestationHooks.java b/core/java/com/android/internal/gmscompat/AttestationHooks.java
index 65469239a0c6..328d9777b2a2 100644
--- a/core/java/com/android/internal/gmscompat/AttestationHooks.java
+++ b/core/java/com/android/internal/gmscompat/AttestationHooks.java
@@ -54,8 +54,9 @@ public final class AttestationHooks {
}
private static void spoofBuildGms() {
- // Alter model name to avoid hardware attestation enforcement
- setBuildField("MODEL", "Pixel 5a");
+ // Alter model name and fingerprint to avoid hardware attestation enforcement
+ setBuildField("FINGERPRINT", "google/angler/angler:6.0/MDB08L/2343525:user/release-keys");
+ setBuildField("MODEL", "Nexus 6P");
}
public static void initApplicationBeforeOnCreate(Application app) {
@@ -67,7 +68,6 @@ public final class AttestationHooks {
if (PACKAGE_FINSKY.equals(app.getPackageName())) {
sIsFinsky = true;
- spoofBuildGms();
}
}
--
2.34.1

View File

@ -0,0 +1,27 @@
From bdd113e11896541b2e4df0fcb9dd94ce3334e933 Mon Sep 17 00:00:00 2001
From: Dyneteve <dyneteve@hentaios.com>
Date: Tue, 6 Dec 2022 15:59:08 +0100
Subject: [PATCH 22/24] gmscompat: Use actual device model name
Signed-off-by: Dyneteve <dyneteve@hentaios.com>
Change-Id: I454654d87b3ea6286e12e9a9f5ed120f06cb2aa6
---
core/java/com/android/internal/gmscompat/AttestationHooks.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/core/java/com/android/internal/gmscompat/AttestationHooks.java b/core/java/com/android/internal/gmscompat/AttestationHooks.java
index 328d9777b2a2..7649bb6533da 100644
--- a/core/java/com/android/internal/gmscompat/AttestationHooks.java
+++ b/core/java/com/android/internal/gmscompat/AttestationHooks.java
@@ -56,7 +56,7 @@ public final class AttestationHooks {
private static void spoofBuildGms() {
// Alter model name and fingerprint to avoid hardware attestation enforcement
setBuildField("FINGERPRINT", "google/angler/angler:6.0/MDB08L/2343525:user/release-keys");
- setBuildField("MODEL", "Nexus 6P");
+ setBuildField("MODEL", Build.MODEL + "\u200b");
}
public static void initApplicationBeforeOnCreate(Application app) {
--
2.34.1

View File

@ -0,0 +1,57 @@
From b4b83ed885d8c3751220ab7270ff0819ea37fb5e Mon Sep 17 00:00:00 2001
From: Anirudh Gupta <anirudhgupta109@aosip.dev>
Date: Wed, 4 Jan 2023 18:20:56 +0000
Subject: [PATCH 23/24] gmscompat: Set shipping level to 32 for devices >=33
If ro.product.first_api_level is 33, its forced to use HW attestation even though the safteynet checker app shows BASIC
setting it to 32 allows for software attestation and passing CTS
Change-Id: Ie7326eaac48424cdea3d9633ebe13c65053ef6c1
Signed-off-by: Dyneteve <dyneteve@hentaios.com>
---
.../internal/gmscompat/AttestationHooks.java | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/core/java/com/android/internal/gmscompat/AttestationHooks.java b/core/java/com/android/internal/gmscompat/AttestationHooks.java
index 7649bb6533da..d2b1d2879c9c 100644
--- a/core/java/com/android/internal/gmscompat/AttestationHooks.java
+++ b/core/java/com/android/internal/gmscompat/AttestationHooks.java
@@ -18,6 +18,7 @@ package com.android.internal.gmscompat;
import android.app.Application;
import android.os.Build;
+import android.os.Build.VERSION;
import android.os.SystemProperties;
import android.util.Log;
@@ -53,10 +54,27 @@ public final class AttestationHooks {
}
}
+ private static void setVersionField(String key, Integer value) {
+ try {
+ // Unlock
+ Field field = Build.VERSION.class.getDeclaredField(key);
+ field.setAccessible(true);
+
+ // Edit
+ field.set(null, value);
+
+ // Lock
+ field.setAccessible(false);
+ } catch (NoSuchFieldException | IllegalAccessException e) {
+ Log.e(TAG, "Failed to spoof Build." + key, e);
+ }
+ }
+
private static void spoofBuildGms() {
// Alter model name and fingerprint to avoid hardware attestation enforcement
setBuildField("FINGERPRINT", "google/angler/angler:6.0/MDB08L/2343525:user/release-keys");
setBuildField("MODEL", Build.MODEL + "\u200b");
+ setVersionField("DEVICE_INITIAL_SDK_INT", Build.VERSION_CODES.S);
}
public static void initApplicationBeforeOnCreate(Application app) {
--
2.34.1

View File

@ -0,0 +1,65 @@
From 2d053efcdbc7ad46ab7cae4550c3134b6ca5ba62 Mon Sep 17 00:00:00 2001
From: Dyneteve <dyneteve@hentaios.com>
Date: Wed, 8 Feb 2023 15:21:01 +0000
Subject: [PATCH 24/24] gmscompat: Make CTS/Play Integrity pass again
The logic behind CTS and Play Integrity has been updated today it now
checks the product and model names against the fingerprint and if
they do not match the CTS profile will fail.
Also while we are at it use a newer FP from Pixel XL and add logging
for key attestation blocking for debugging.
Test: Boot, check for CTS and Play Integrity
Change-Id: I089d5ef935bba40338e10c795ea7d181103ffd15
Signed-off-by: Dyneteve <dyneteve@hentaios.com>
---
.../internal/gmscompat/AttestationHooks.java | 20 +++++++++----------
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/core/java/com/android/internal/gmscompat/AttestationHooks.java b/core/java/com/android/internal/gmscompat/AttestationHooks.java
index d2b1d2879c9c..ef7a308a25bc 100644
--- a/core/java/com/android/internal/gmscompat/AttestationHooks.java
+++ b/core/java/com/android/internal/gmscompat/AttestationHooks.java
@@ -72,9 +72,11 @@ public final class AttestationHooks {
private static void spoofBuildGms() {
// Alter model name and fingerprint to avoid hardware attestation enforcement
- setBuildField("FINGERPRINT", "google/angler/angler:6.0/MDB08L/2343525:user/release-keys");
- setBuildField("MODEL", Build.MODEL + "\u200b");
- setVersionField("DEVICE_INITIAL_SDK_INT", Build.VERSION_CODES.S);
+ setBuildField("FINGERPRINT", "google/marlin/marlin:7.1.2/NJH47F/4146041:user/release-keys");
+ setBuildField("PRODUCT", "marlin");
+ setBuildField("DEVICE", "marlin");
+ setBuildField("MODEL", "Pixel XL");
+ setVersionField("DEVICE_INITIAL_SDK_INT", Build.VERSION_CODES.N_MR1);
}
public static void initApplicationBeforeOnCreate(Application app) {
@@ -90,18 +92,14 @@ public final class AttestationHooks {
}
private static boolean isCallerSafetyNet() {
- return Arrays.stream(Thread.currentThread().getStackTrace())
+ return sIsGms && Arrays.stream(Thread.currentThread().getStackTrace())
.anyMatch(elem -> elem.getClassName().contains("DroidGuard"));
}
public static void onEngineGetCertificateChain() {
- // Check stack for SafetyNet
- if (sIsGms && isCallerSafetyNet()) {
- throw new UnsupportedOperationException();
- }
-
- // Check stack for PlayIntegrity
- if (sIsFinsky) {
+ // Check stack for SafetyNet or Play Integrity
+ if (isCallerSafetyNet() || sIsFinsky) {
+ Log.i(TAG, "Blocked key attestation sIsGms=" + sIsGms + " sIsFinsky=" + sIsFinsky);
throw new UnsupportedOperationException();
}
}
--
2.34.1

View File

@ -1,4 +1,4 @@
From d8f9f479012d522aed7377e5996cf7a5265ea268 Mon Sep 17 00:00:00 2001
From 316e6779dde5db01258fcf5139e1d4a33933b114 Mon Sep 17 00:00:00 2001
From: Vachounet <vachounet@live.fr>
Date: Mon, 26 Oct 2020 17:05:18 +0100
Subject: [PATCH] Trebuchet: Move clear all button to actions view
@ -73,10 +73,10 @@ index 0fda0bf8d4..9a6f5ae062 100644
\ No newline at end of file
+</com.android.quickstep.views.OverviewActionsView>
diff --git a/quickstep/src/com/android/quickstep/fallback/RecentsState.java b/quickstep/src/com/android/quickstep/fallback/RecentsState.java
index 223eba5b95..75f8baed6b 100644
index 8b5f091e11..601021b5bf 100644
--- a/quickstep/src/com/android/quickstep/fallback/RecentsState.java
+++ b/quickstep/src/com/android/quickstep/fallback/RecentsState.java
@@ -105,7 +105,7 @@ public class RecentsState implements BaseState<RecentsState> {
@@ -106,7 +106,7 @@ public class RecentsState implements BaseState<RecentsState> {
* For this state, whether clear all button should be shown.
*/
public boolean hasClearAllButton() {
@ -86,7 +86,7 @@ index 223eba5b95..75f8baed6b 100644
/**
diff --git a/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java b/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java
index bb8506d26f..e8c18f1d45 100644
index 6c27587058..dbaf180e68 100644
--- a/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java
@@ -143,8 +143,7 @@ public class LauncherRecentsView extends RecentsView<QuickstepLauncher, Launcher
@ -98,12 +98,12 @@ index bb8506d26f..e8c18f1d45 100644
+ boolean hasClearAllButton = false;
setDisallowScrollToClearAll(!hasClearAllButton);
}
}
if (mActivity.getDesktopVisibilityController() != null) {
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index 7ad0e48ccb..e888aa2c74 100644
index 5e645ea917..0dc0b3b62e 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -110,6 +110,7 @@ import android.view.ViewTreeObserver.OnScrollChangedListener;
@@ -117,6 +117,7 @@ import android.view.ViewTreeObserver.OnScrollChangedListener;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
import android.view.animation.Interpolator;
@ -111,7 +111,7 @@ index 7ad0e48ccb..e888aa2c74 100644
import android.widget.ListView;
import android.widget.OverScroller;
import android.widget.Toast;
@@ -464,6 +465,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
@@ -472,6 +473,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
private final RecentsModel mModel;
private final int mSplitPlaceholderSize;
private final int mSplitPlaceholderInset;
@ -119,7 +119,7 @@ index 7ad0e48ccb..e888aa2c74 100644
private final ClearAllButton mClearAllButton;
private final Rect mClearAllButtonDeadZoneRect = new Rect();
private final Rect mTaskViewDeadZoneRect = new Rect();
@@ -911,6 +913,8 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
@@ -976,6 +978,8 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
mActionsView = actionsView;
mActionsView.updateHiddenFlags(HIDDEN_NO_TASKS, getTaskViewCount() == 0);
mSplitSelectStateController = splitController;
@ -128,7 +128,7 @@ index 7ad0e48ccb..e888aa2c74 100644
}
public SplitSelectStateController getSplitSelectController() {
@@ -1230,7 +1234,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
@@ -1342,7 +1346,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
* button fully visible, center page is Clear All button.
*/
public boolean isClearAllHidden() {
@ -138,5 +138,5 @@ index 7ad0e48ccb..e888aa2c74 100644
@Override
--
2.25.1
2.34.1

View File

@ -1,4 +1,4 @@
From d6798034133d378b48f226e876e679b0131c1dbd Mon Sep 17 00:00:00 2001
From 630ef309d41f80ba621c9646d44e1480a2c1b06b Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 20 Jun 2021 03:39:32 +0000
Subject: [PATCH 01/21] Add MiuiNavbarOverlay
@ -385,5 +385,5 @@ literal 0
HcmV?d00001
--
2.25.1
2.34.1

View File

@ -1,4 +1,4 @@
From 3d733c87e62d1b84124e5a2c1172bb94df3501d2 Mon Sep 17 00:00:00 2001
From df749c8f69ea955f7ce2894ef73f0b395b6aa86d Mon Sep 17 00:00:00 2001
From: Hikari-no-Tenshi <kyryljan.serhij@gmail.com>
Date: Thu, 30 Jan 2020 22:20:54 +0200
Subject: [PATCH 02/21] Disable Bluetooth by default
@ -9,7 +9,7 @@ Change-Id: Iea5d24f977928bf01cd7a46b98c75c0a4bd6a23c
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml
index 7732da40aac2..1d2c343a4514 100644
index 99b15db780dc..cff3e668f053 100644
--- a/packages/SettingsProvider/res/values/defaults.xml
+++ b/packages/SettingsProvider/res/values/defaults.xml
@@ -36,7 +36,7 @@
@ -22,5 +22,5 @@ index 7732da40aac2..1d2c343a4514 100644
<bool name="def_install_non_market_apps">false</bool>
<!-- 0 == off, 3 == on -->
--
2.25.1
2.34.1

View File

@ -1,4 +1,4 @@
From 1a6a0ac98a327cfee7e3d703792ef456197ae212 Mon Sep 17 00:00:00 2001
From 3446855cc0673b68bbd3558362e282c5b1decf51 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Mon, 27 Sep 2021 16:30:00 +0000
Subject: [PATCH 03/21] Disable cursor drag by default for editable TextViews
@ -24,5 +24,5 @@ index fb40ee5ec843..c0c6fb6e9431 100644
/**
* Threshold for the direction of a swipe gesture in order for it to be handled as a cursor drag
--
2.25.1
2.34.1

View File

@ -1,4 +1,4 @@
From 57b4bdcc55b85a0c92a348c23e31e6d7d373ba83 Mon Sep 17 00:00:00 2001
From 4706b07fb66ea1a0f10a5bb84cda6780cb10f4a3 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 3 Jul 2022 00:08:42 +0000
Subject: [PATCH 04/21] Disable "RESTRICTED bucket" toast
@ -9,10 +9,10 @@ Change-Id: I20a328d3c77962f3a6095bfca42d0b165a093ce8
1 file changed, 1 insertion(+), 19 deletions(-)
diff --git a/apex/jobscheduler/service/java/com/android/server/usage/AppStandbyController.java b/apex/jobscheduler/service/java/com/android/server/usage/AppStandbyController.java
index 5d9f3357125a..49d3c8de7b80 100644
index a6f47d4e4908..ac7cabba3ddc 100644
--- a/apex/jobscheduler/service/java/com/android/server/usage/AppStandbyController.java
+++ b/apex/jobscheduler/service/java/com/android/server/usage/AppStandbyController.java
@@ -1759,25 +1759,7 @@ public class AppStandbyController
@@ -1781,25 +1781,7 @@ public class AppStandbyController
.noteRestrictionAttempt(packageName, userId, elapsedRealtime, reason);
if (isForcedByUser) {
@ -40,5 +40,5 @@ index 5d9f3357125a..49d3c8de7b80 100644
final long timeUntilRestrictPossibleMs = app.lastUsedByUserElapsedTime
+ mInjector.getAutoRestrictedBucketDelayMs() - elapsedRealtime;
--
2.25.1
2.34.1

View File

@ -1,4 +1,4 @@
From 2288c34ff8bf06a7be040815ff4d6496eb36062a Mon Sep 17 00:00:00 2001
From 2362d29a436aa9483f6913e022567d6f9fd90332 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Thu, 2 Sep 2021 16:15:19 +0000
Subject: [PATCH 05/21] Keyguard: Adjust clock style
@ -7,19 +7,84 @@ Thinner font, less padding and unintrusive colors
Change-Id: I21e5d5bf37d724e75ebce4cd89349e0cc4dfc910
---
.../customization/res/layout/clock_default_large.xml | 1 +
.../customization/res/layout/clock_default_small.xml | 2 +-
packages/SystemUI/customization/res/values/colors.xml | 5 +++++
.../android/systemui/shared/clocks/AnimatableClockView.kt | 2 +-
.../systemui/shared/clocks/DefaultClockController.kt | 4 ++--
.../SystemUI/res-keyguard/layout/keyguard_slice_view.xml | 2 +-
packages/SystemUI/res-keyguard/values/dimens.xml | 6 +++---
packages/SystemUI/res-keyguard/values/styles.xml | 2 --
packages/SystemUI/res/layout/keyguard_status_bar.xml | 2 +-
packages/SystemUI/res/values/styles.xml | 4 ++--
packages/SystemUI/shared/res/layout/clock_default_large.xml | 1 +
packages/SystemUI/shared/res/layout/clock_default_small.xml | 2 +-
packages/SystemUI/shared/res/values/colors.xml | 5 +++++
.../android/systemui/shared/clocks/AnimatableClockView.kt | 2 +-
.../android/systemui/shared/clocks/DefaultClockProvider.kt | 4 ++--
10 files changed, 17 insertions(+), 13 deletions(-)
create mode 100644 packages/SystemUI/shared/res/values/colors.xml
create mode 100644 packages/SystemUI/customization/res/values/colors.xml
diff --git a/packages/SystemUI/customization/res/layout/clock_default_large.xml b/packages/SystemUI/customization/res/layout/clock_default_large.xml
index 0139d50dcfba..9f5ca7b89213 100644
--- a/packages/SystemUI/customization/res/layout/clock_default_large.xml
+++ b/packages/SystemUI/customization/res/layout/clock_default_large.xml
@@ -26,6 +26,7 @@
android:fontFamily="@*android:string/config_clockFontFamily"
android:typeface="monospace"
android:elegantTextHeight="false"
+ android:fontFeatureSettings="tnum"
chargeAnimationDelay="200"
dozeWeight="200"
lockScreenWeight="400" />
diff --git a/packages/SystemUI/customization/res/layout/clock_default_small.xml b/packages/SystemUI/customization/res/layout/clock_default_small.xml
index ff6d7f9e2240..b63ffce20671 100644
--- a/packages/SystemUI/customization/res/layout/clock_default_small.xml
+++ b/packages/SystemUI/customization/res/layout/clock_default_small.xml
@@ -27,7 +27,7 @@
android:elegantTextHeight="false"
android:ellipsize="none"
android:singleLine="true"
- android:fontFeatureSettings="pnum"
+ android:fontFeatureSettings="tnum"
chargeAnimationDelay="350"
dozeWeight="200"
lockScreenWeight="400" />
diff --git a/packages/SystemUI/customization/res/values/colors.xml b/packages/SystemUI/customization/res/values/colors.xml
new file mode 100644
index 000000000000..f80af4376ff1
--- /dev/null
+++ b/packages/SystemUI/customization/res/values/colors.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <color name="clock_default_color_dark">@*android:color/primary_text_material_dark</color>
+ <color name="clock_default_color_light">@*android:color/primary_text_material_light</color>
+</resources>
diff --git a/packages/SystemUI/customization/src/com/android/systemui/shared/clocks/AnimatableClockView.kt b/packages/SystemUI/customization/src/com/android/systemui/shared/clocks/AnimatableClockView.kt
index 462b90a10aee..d5fdb185d042 100644
--- a/packages/SystemUI/customization/src/com/android/systemui/shared/clocks/AnimatableClockView.kt
+++ b/packages/SystemUI/customization/src/com/android/systemui/shared/clocks/AnimatableClockView.kt
@@ -147,7 +147,7 @@ class AnimatableClockView @JvmOverloads constructor(
fun refreshTime() {
time.timeInMillis = timeOverrideInMillis ?: System.currentTimeMillis()
contentDescription = DateFormat.format(descFormat, time)
- val formattedText = DateFormat.format(format, time)
+ val formattedText = DateFormat.format(format, time).toString() + ' '
logBuffer?.log(tag, DEBUG,
{ str1 = formattedText?.toString() },
{ "refreshTime: new formattedText=$str1" }
diff --git a/packages/SystemUI/customization/src/com/android/systemui/shared/clocks/DefaultClockController.kt b/packages/SystemUI/customization/src/com/android/systemui/shared/clocks/DefaultClockController.kt
index e138ef8a1ea8..fa7979a0b598 100644
--- a/packages/SystemUI/customization/src/com/android/systemui/shared/clocks/DefaultClockController.kt
+++ b/packages/SystemUI/customization/src/com/android/systemui/shared/clocks/DefaultClockController.kt
@@ -131,9 +131,9 @@ class DefaultClockController(
fun updateColor() {
val color =
if (isRegionDark) {
- resources.getColor(android.R.color.system_accent1_100)
+ resources.getColor(R.color.clock_default_color_dark)
} else {
- resources.getColor(android.R.color.system_accent2_600)
+ resources.getColor(R.color.clock_default_color_light)
}
if (currentColor == color) {
diff --git a/packages/SystemUI/res-keyguard/layout/keyguard_slice_view.xml b/packages/SystemUI/res-keyguard/layout/keyguard_slice_view.xml
index 7c5dbc247428..64657547621f 100644
--- a/packages/SystemUI/res-keyguard/layout/keyguard_slice_view.xml
@ -34,10 +99,10 @@ index 7c5dbc247428..64657547621f 100644
/>
</com.android.keyguard.KeyguardSliceView>
diff --git a/packages/SystemUI/res-keyguard/values/dimens.xml b/packages/SystemUI/res-keyguard/values/dimens.xml
index 46f6ab2399d1..6fce16ced94f 100644
index c5ffdc0051da..b3f3d46c5dcd 100644
--- a/packages/SystemUI/res-keyguard/values/dimens.xml
+++ b/packages/SystemUI/res-keyguard/values/dimens.xml
@@ -91,10 +91,10 @@
@@ -94,10 +94,10 @@
<dimen name="num_pad_key_margin_end">12dp</dimen>
<!-- additional offset for clock switch area items -->
@ -52,7 +117,7 @@ index 46f6ab2399d1..6fce16ced94f 100644
<!-- Proportion of the screen height to use to set the maximum height of the bouncer to when
the device is in the DEVICE_POSTURE_HALF_OPENED posture, for the PIN/pattern entry. 0 will
diff --git a/packages/SystemUI/res-keyguard/values/styles.xml b/packages/SystemUI/res-keyguard/values/styles.xml
index a1d12668d27a..955e24e01a9a 100644
index 04dffb6e8c52..c81e018702bb 100644
--- a/packages/SystemUI/res-keyguard/values/styles.xml
+++ b/packages/SystemUI/res-keyguard/values/styles.xml
@@ -117,8 +117,6 @@
@ -65,10 +130,10 @@ index a1d12668d27a..955e24e01a9a 100644
<style name="TextAppearance.Keyguard.Secondary">
diff --git a/packages/SystemUI/res/layout/keyguard_status_bar.xml b/packages/SystemUI/res/layout/keyguard_status_bar.xml
index d27fa192e741..2480d0189e16 100644
index 8b8594032816..9135e78f3e4c 100644
--- a/packages/SystemUI/res/layout/keyguard_status_bar.xml
+++ b/packages/SystemUI/res/layout/keyguard_status_bar.xml
@@ -91,7 +91,7 @@
@@ -74,7 +74,7 @@
android:gravity="center_vertical"
android:ellipsize="marquee"
android:textDirection="locale"
@ -78,19 +143,19 @@ index d27fa192e741..2480d0189e16 100644
android:singleLine="true"
systemui:showMissingSim="true"
diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml
index a10878709364..78fd8ab3b324 100644
index dfc6ba4720f2..6c5e6d73feb7 100644
--- a/packages/SystemUI/res/values/styles.xml
+++ b/packages/SystemUI/res/values/styles.xml
@@ -276,7 +276,7 @@
@@ -301,7 +301,7 @@
<item name="darkIconTheme">@style/DualToneDarkTheme</item>
<item name="wallpaperTextColor">@*android:color/primary_text_material_dark</item>
<item name="wallpaperTextColorSecondary">@*android:color/secondary_text_material_dark</item>
- <item name="wallpaperTextColorAccent">@color/material_dynamic_primary90</item>
+ <item name="wallpaperTextColorAccent">@*android:color/primary_text_material_dark</item>
<item name="android:colorError">@*android:color/error_color_material_dark</item>
<item name="*android:lockPatternStyle">@style/LockPatternStyle</item>
<item name="passwordStyle">@style/PasswordTheme</item>
@@ -292,7 +292,7 @@
<item name="*android:lockPatternStyle">@style/LockPatternViewStyle</item>
<item name="lockPatternStyle">@style/LockPatternContainerStyle</item>
@@ -323,7 +323,7 @@
<style name="Theme.SystemUI.LightWallpaper">
<item name="wallpaperTextColor">@*android:color/primary_text_material_light</item>
<item name="wallpaperTextColorSecondary">@*android:color/secondary_text_material_light</item>
@ -99,71 +164,6 @@ index a10878709364..78fd8ab3b324 100644
<item name="android:colorError">@*android:color/error_color_material_light</item>
<item name="shadowRadius">0</item>
diff --git a/packages/SystemUI/shared/res/layout/clock_default_large.xml b/packages/SystemUI/shared/res/layout/clock_default_large.xml
index 0139d50dcfba..9f5ca7b89213 100644
--- a/packages/SystemUI/shared/res/layout/clock_default_large.xml
+++ b/packages/SystemUI/shared/res/layout/clock_default_large.xml
@@ -26,6 +26,7 @@
android:fontFamily="@*android:string/config_clockFontFamily"
android:typeface="monospace"
android:elegantTextHeight="false"
+ android:fontFeatureSettings="tnum"
chargeAnimationDelay="200"
dozeWeight="200"
lockScreenWeight="400" />
diff --git a/packages/SystemUI/shared/res/layout/clock_default_small.xml b/packages/SystemUI/shared/res/layout/clock_default_small.xml
index ff6d7f9e2240..b63ffce20671 100644
--- a/packages/SystemUI/shared/res/layout/clock_default_small.xml
+++ b/packages/SystemUI/shared/res/layout/clock_default_small.xml
@@ -27,7 +27,7 @@
android:elegantTextHeight="false"
android:ellipsize="none"
android:singleLine="true"
- android:fontFeatureSettings="pnum"
+ android:fontFeatureSettings="tnum"
chargeAnimationDelay="350"
dozeWeight="200"
lockScreenWeight="400" />
diff --git a/packages/SystemUI/shared/res/values/colors.xml b/packages/SystemUI/shared/res/values/colors.xml
new file mode 100644
index 000000000000..f80af4376ff1
--- /dev/null
+++ b/packages/SystemUI/shared/res/values/colors.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <color name="clock_default_color_dark">@*android:color/primary_text_material_dark</color>
+ <color name="clock_default_color_light">@*android:color/primary_text_material_light</color>
+</resources>
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/clocks/AnimatableClockView.kt b/packages/SystemUI/shared/src/com/android/systemui/shared/clocks/AnimatableClockView.kt
index c2e74456c032..555c20bfed9c 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/clocks/AnimatableClockView.kt
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/clocks/AnimatableClockView.kt
@@ -148,7 +148,7 @@ class AnimatableClockView @JvmOverloads constructor(
fun refreshTime() {
time.timeInMillis = timeOverrideInMillis ?: System.currentTimeMillis()
contentDescription = DateFormat.format(descFormat, time)
- val formattedText = DateFormat.format(format, time)
+ val formattedText = DateFormat.format(format, time).toString() + ' '
// Setting text actually triggers a layout pass (because the text view is set to
// wrap_content width and TextView always relayouts for this). Avoid needless
// relayout if the text didn't actually change.
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/clocks/DefaultClockProvider.kt b/packages/SystemUI/shared/src/com/android/systemui/shared/clocks/DefaultClockProvider.kt
index 19ac2e479bcb..92a05c540f94 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/clocks/DefaultClockProvider.kt
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/clocks/DefaultClockProvider.kt
@@ -230,9 +230,9 @@ class DefaultClock(
private fun updateClockColor(clock: AnimatableClockView, isRegionDark: Boolean) {
val color = if (isRegionDark) {
- resources.getColor(android.R.color.system_accent1_100)
+ resources.getColor(R.color.clock_default_color_dark)
} else {
- resources.getColor(android.R.color.system_accent2_600)
+ resources.getColor(R.color.clock_default_color_light)
}
clock.setColors(DOZE_COLOR, color)
clock.animateAppearOnLockscreen()
--
2.25.1
2.34.1

View File

@ -1,4 +1,4 @@
From 9524ee57bd44eba56aa592164544f623a010614a Mon Sep 17 00:00:00 2001
From f3928474b86986827588d05535cc045156becbde Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sat, 2 Nov 2019 06:41:03 +0000
Subject: [PATCH 06/21] Keyguard: Hide padlock unless UDFPS is in use
@ -11,10 +11,10 @@ Change-Id: Ie91e80ca5c6637a51a8acc72fb28cd6ac2a7abb6
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java b/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java
index 2a3667610f9c..12905c70fc21 100644
index 1322f16a5a59..3df030b50ed5 100644
--- a/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java
@@ -254,20 +254,14 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
@@ -295,20 +295,14 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
return;
}
@ -39,5 +39,5 @@ index 2a3667610f9c..12905c70fc21 100644
// fp icon was shown by UdfpsView, and now we still want to animate the transition
// in this drawable
--
2.25.1
2.34.1

View File

@ -1,4 +1,4 @@
From 97ad90dbfeab360820f198a39c48fd6f7d1139b6 Mon Sep 17 00:00:00 2001
From 67e73c9aa252581a81f0dabcc6b8a7067da040ac Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Wed, 1 Sep 2021 14:41:53 +0000
Subject: [PATCH 07/21] Keyguard: Never switch to large clock
@ -11,10 +11,10 @@ Change-Id: I434d033ecae597ed2a7b2ed71e96ba1a963e9cc3
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java
index 2165099b474e..3b137c932139 100644
index 788f1200d603..45d045785e2d 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java
@@ -376,7 +376,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
@@ -392,7 +392,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
private void updateDoubleLineClock() {
mCanShowDoubleLineClock = mSecureSettings.getIntForUser(
@ -24,5 +24,5 @@ index 2165099b474e..3b137c932139 100644
if (!mCanShowDoubleLineClock) {
--
2.25.1
2.34.1

View File

@ -1,20 +1,20 @@
From c7579711632d2fc79e9775bb79e3f56126accbc3 Mon Sep 17 00:00:00 2001
From 5b078c1242e2d69a887b56130b0f12609269ad89 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sat, 2 Nov 2019 08:31:36 +0000
Subject: [PATCH 08/21] Keyguard: Refine indication text
Change-Id: Ib771c35610f712a1de34736e817bcfe616ac37d8
---
packages/SystemUI/res-keyguard/values/styles.xml | 2 --
.../SystemUI/res/layout/keyguard_bottom_area.xml | 1 +
.../SystemUI/res-keyguard/values/styles.xml | 2 --
.../res/layout/keyguard_bottom_area.xml | 1 +
packages/SystemUI/res/values/dimens.xml | 3 +--
.../KeyguardIndicationRotateTextViewController.java | 12 +++++++++++-
.../statusbar/KeyguardIndicationController.java | 7 ++++---
.../statusbar/phone/KeyguardIndicationTextView.java | 2 +-
6 files changed, 18 insertions(+), 9 deletions(-)
...ardIndicationRotateTextViewController.java | 12 +++++++++-
.../KeyguardIndicationController.java | 23 ++++---------------
.../phone/KeyguardIndicationTextView.java | 2 +-
6 files changed, 18 insertions(+), 25 deletions(-)
diff --git a/packages/SystemUI/res-keyguard/values/styles.xml b/packages/SystemUI/res-keyguard/values/styles.xml
index 955e24e01a9a..58c6919971a1 100644
index c81e018702bb..cc87f9f3d7cf 100644
--- a/packages/SystemUI/res-keyguard/values/styles.xml
+++ b/packages/SystemUI/res-keyguard/values/styles.xml
@@ -132,8 +132,6 @@
@ -27,7 +27,7 @@ index 955e24e01a9a..58c6919971a1 100644
<style name="TextAppearance.Keyguard.BottomArea.Button">
diff --git a/packages/SystemUI/res/layout/keyguard_bottom_area.xml b/packages/SystemUI/res/layout/keyguard_bottom_area.xml
index 8df8c49ee057..ff616b66790d 100644
index 6120863f23ab..5fd81bad8226 100644
--- a/packages/SystemUI/res/layout/keyguard_bottom_area.xml
+++ b/packages/SystemUI/res/layout/keyguard_bottom_area.xml
@@ -35,6 +35,7 @@
@ -39,16 +39,16 @@ index 8df8c49ee057..ff616b66790d 100644
android:paddingEnd="@dimen/keyguard_indication_text_padding"
android:textAppearance="@style/TextAppearance.Keyguard.BottomArea"
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 9c85fbc4b391..44766f3b6a6d 100644
index 1165c0d1eda1..750fb574c30c 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -760,11 +760,10 @@
@@ -774,11 +774,10 @@
<dimen name="keyguard_lock_height">42dp</dimen>
<dimen name="keyguard_lock_padding">20dp</dimen>
- <dimen name="keyguard_indication_margin_bottom">32dp</dimen>
+ <dimen name="keyguard_indication_margin_bottom">16dp</dimen>
<dimen name="lock_icon_margin_bottom">110dp</dimen>
<dimen name="lock_icon_margin_bottom">74dp</dimen>
<dimen name="ambient_indication_margin_bottom">71dp</dimen>
-
@ -56,7 +56,7 @@ index 9c85fbc4b391..44766f3b6a6d 100644
<dimen name="double_tap_slop">32dp</dimen>
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardIndicationRotateTextViewController.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardIndicationRotateTextViewController.java
index f84a5e39163f..38baa611cf07 100644
index 9235e10209d4..42e710d9c9a3 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardIndicationRotateTextViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardIndicationRotateTextViewController.java
@@ -220,12 +220,22 @@ public class KeyguardIndicationRotateTextViewController extends
@ -67,7 +67,7 @@ index f84a5e39163f..38baa611cf07 100644
+ * @return true if there are available non-resting indications to show.
*/
public boolean hasIndications() {
+ if (hasIndication(INDICATION_TYPE_RESTING)) {
+ if (hasIndication(INDICATION_TYPE_PERSISTENT_UNLOCK_MESSAGE)) {
+ return mIndicationMessages.keySet().size() > 1;
+ }
return mIndicationMessages.keySet().size() > 0;
@ -84,10 +84,10 @@ index f84a5e39163f..38baa611cf07 100644
* Clears all messages in the queue and sets the current message to an empty string.
*/
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
index 073ab8b16864..5fb3c05c4a2a 100644
index 6a658b6ee047..632d186ac4f4 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
@@ -267,10 +267,12 @@ public class KeyguardIndicationController {
@@ -270,10 +270,12 @@ public class KeyguardIndicationController {
public void handleMessage(Message msg) {
if (msg.what == MSG_HIDE_TRANSIENT) {
hideTransientIndication();
@ -100,21 +100,51 @@ index 073ab8b16864..5fb3c05c4a2a 100644
} else if (msg.what == MSG_RESET_ERROR_MESSAGE_ON_SCREEN_ON) {
mBiometricErrorMessageToShowOnScreenOn = null;
}
@@ -588,12 +590,11 @@ public class KeyguardIndicationController {
@@ -375,7 +377,6 @@ public class KeyguardIndicationController {
updateLockScreenDisclosureMsg();
updateLockScreenOwnerInfo();
updateLockScreenBatteryMsg(animate);
- updateLockScreenUserLockedMsg(userId);
updateLockScreenTrustMsg(userId, getTrustGrantedIndication(), getTrustManagedIndication());
updateLockScreenAlignmentMsg();
updateLockScreenLogoutView();
@@ -484,22 +485,6 @@ public class KeyguardIndicationController {
}
}
private void updateLockScreenRestingMsg() {
- if (!TextUtils.isEmpty(mRestingIndication)
- && !mRotateTextViewController.hasIndications()) {
- private void updateLockScreenUserLockedMsg(int userId) {
- if (!mKeyguardUpdateMonitor.isUserUnlocked(userId)
- || mKeyguardUpdateMonitor.isEncryptedOrLockdown(userId)) {
- mRotateTextViewController.updateIndication(
- INDICATION_TYPE_USER_LOCKED,
- new KeyguardIndication.Builder()
- .setMessage(mContext.getResources().getText(
- com.android.internal.R.string.lockscreen_storage_locked))
- .setTextColor(mInitialTextColorState)
- .build(),
- false);
- } else {
- mRotateTextViewController.hideIndication(INDICATION_TYPE_USER_LOCKED);
- }
- }
-
private void updateBiometricMessage() {
if (mDozing) {
updateDeviceEntryIndication(false);
@@ -592,11 +577,11 @@ public class KeyguardIndicationController {
}
private void updateLockScreenPersistentUnlockMsg() {
- if (!TextUtils.isEmpty(mPersistentUnlockMessage)) {
+ if (!mRotateTextViewController.hasIndications()) {
mRotateTextViewController.updateIndication(
INDICATION_TYPE_RESTING,
INDICATION_TYPE_PERSISTENT_UNLOCK_MESSAGE,
new KeyguardIndication.Builder()
- .setMessage(mRestingIndication)
- .setMessage(mPersistentUnlockMessage)
+ .setMessage(mContext.getResources().getString(R.string.keyguard_unlock))
.setTextColor(mInitialTextColorState)
.build(),
false);
true);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardIndicationTextView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardIndicationTextView.java
index d24469e8421e..647c766aa0f0 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardIndicationTextView.java
@ -129,5 +159,5 @@ index d24469e8421e..647c766aa0f0 100644
private KeyguardIndication mKeyguardIndicationInfo;
--
2.25.1
2.34.1

View File

@ -0,0 +1,165 @@
From 146d8cbf38f17136e1aed47d634ff833f5a5fc8d Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sat, 20 Mar 2021 10:35:14 +0000
Subject: [PATCH 09/21] Keyguard/UI: Fix status bar / quick settings margins
and paddings
Last revised on 2023/03/22, targeting T QPR2
The way I think SB/QS margins/paddings should work:
- Devices with left notch: [notch_definition][status_bar_padding_start][content]...[content][status_bar_padding_end][rounded_corner_content_padding]
- Devices with center or no notch: [rounded_corner_content_padding][status_bar_padding_start][content]...[content][status_bar_padding_end][rounded_corner_content_padding]
Key point being:
- SB (including keyguard) and QS should always act uniformly
- Notch definition should only be the notch itself, without additional padding
- Instead, these paddings should be covered by status_bar_padding_{start|end}
As a result, below changes have been made:
- Change keyguard_carrier_text_margin into a padding and link to status_bar_padding_start
- Add status_bar_padding_{start|end} to quick settings header
- Remove unnecessary margins and paddings if any
Change-Id: Ic91fa398813e1907297bb0892c444d96405950e7
---
packages/SystemUI/res/layout/combined_qs_header.xml | 2 +-
packages/SystemUI/res/layout/keyguard_status_bar.xml | 2 +-
packages/SystemUI/res/values-sw600dp/dimens.xml | 3 ---
packages/SystemUI/res/values/dimens.xml | 2 +-
packages/SystemUI/res/xml/qqs_header.xml | 4 ++--
.../systemui/shade/LargeScreenShadeHeaderController.kt | 10 +++++++---
.../statusbar/phone/KeyguardStatusBarView.java | 7 -------
7 files changed, 12 insertions(+), 18 deletions(-)
diff --git a/packages/SystemUI/res/layout/combined_qs_header.xml b/packages/SystemUI/res/layout/combined_qs_header.xml
index 4b78f2839255..7ac024a97eee 100644
--- a/packages/SystemUI/res/layout/combined_qs_header.xml
+++ b/packages/SystemUI/res/layout/combined_qs_header.xml
@@ -148,4 +148,4 @@
<include layout="@layout/ongoing_privacy_chip"/>
</FrameLayout>
-</com.android.systemui.util.NoRemeasureMotionLayout>
\ No newline at end of file
+</com.android.systemui.util.NoRemeasureMotionLayout>
diff --git a/packages/SystemUI/res/layout/keyguard_status_bar.xml b/packages/SystemUI/res/layout/keyguard_status_bar.xml
index 9135e78f3e4c..ddaea938c858 100644
--- a/packages/SystemUI/res/layout/keyguard_status_bar.xml
+++ b/packages/SystemUI/res/layout/keyguard_status_bar.xml
@@ -69,7 +69,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="@dimen/status_bar_padding_top"
- android:layout_marginStart="@dimen/keyguard_carrier_text_margin"
+ android:paddingStart="@dimen/keyguard_carrier_text_margin"
android:layout_toStartOf="@id/system_icons_container"
android:gravity="center_vertical"
android:ellipsize="marquee"
diff --git a/packages/SystemUI/res/values-sw600dp/dimens.xml b/packages/SystemUI/res/values-sw600dp/dimens.xml
index 599bf30a5135..f9911fda7dbe 100644
--- a/packages/SystemUI/res/values-sw600dp/dimens.xml
+++ b/packages/SystemUI/res/values-sw600dp/dimens.xml
@@ -27,9 +27,6 @@
<!-- The width of user avatar when on Keyguard -->
<dimen name="multi_user_avatar_keyguard_size">30dp</dimen>
- <!-- Margin on the left side of the carrier text on Keyguard -->
- <dimen name="keyguard_carrier_text_margin">24dp</dimen>
-
<!-- The width/height of the phone/camera/unlock icon on keyguard. -->
<dimen name="keyguard_affordance_height">80dp</dimen>
<dimen name="keyguard_affordance_width">120dp</dimen>
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 750fb574c30c..b5854568c117 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -748,7 +748,7 @@
<dimen name="kg_framed_avatar_size">32dp</dimen>
<!-- Margin on the left side of the carrier text on Keyguard -->
- <dimen name="keyguard_carrier_text_margin">16dp</dimen>
+ <dimen name="keyguard_carrier_text_margin">@dimen/status_bar_padding_start</dimen>
<!-- Additional translation (downwards) for appearing notifications when going to the full shade
from Keyguard. -->
diff --git a/packages/SystemUI/res/xml/qqs_header.xml b/packages/SystemUI/res/xml/qqs_header.xml
index e56e5d557c2f..6378705f9db4 100644
--- a/packages/SystemUI/res/xml/qqs_header.xml
+++ b/packages/SystemUI/res/xml/qqs_header.xml
@@ -44,7 +44,7 @@
<Layout
android:layout_width="wrap_content"
android:layout_height="@dimen/new_qs_header_non_clickable_element_height"
- android:layout_marginStart="8dp"
+ android:layout_marginStart="2dp"
app:layout_constrainedWidth="true"
app:layout_constraintStart_toEndOf="@id/clock"
app:layout_constraintEnd_toStartOf="@id/barrier"
@@ -110,4 +110,4 @@
app:layout_constraintHorizontal_bias="1"
/>
</Constraint>
-</ConstraintSet>
\ No newline at end of file
+</ConstraintSet>
diff --git a/packages/SystemUI/src/com/android/systemui/shade/LargeScreenShadeHeaderController.kt b/packages/SystemUI/src/com/android/systemui/shade/LargeScreenShadeHeaderController.kt
index 9795434a6545..cc8e3f48131d 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/LargeScreenShadeHeaderController.kt
+++ b/packages/SystemUI/src/com/android/systemui/shade/LargeScreenShadeHeaderController.kt
@@ -136,6 +136,8 @@ class LargeScreenShadeHeaderController @Inject constructor(
private var cutoutLeft = 0
private var cutoutRight = 0
private var roundedCorners = 0
+ private var statusBarPaddingStart = 0
+ private var statusBarPaddingEnd = 0
private var lastInsets: WindowInsets? = null
private var textColorPrimary = Color.TRANSPARENT
@@ -360,14 +362,17 @@ class LargeScreenShadeHeaderController @Inject constructor(
cutoutLeft = sbInsets.first
cutoutRight = sbInsets.second
val hasCornerCutout: Boolean = insetsProvider.currentRotationHasCornerCutout()
+ roundedCorners = resources.getDimensionPixelSize(R.dimen.rounded_corner_content_padding)
+ statusBarPaddingStart = resources.getDimensionPixelSize(R.dimen.status_bar_padding_start)
+ statusBarPaddingEnd = resources.getDimensionPixelSize(R.dimen.status_bar_padding_end)
updateQQSPaddings()
// Set these guides as the left/right limits for content that lives in the top row, using
// cutoutLeft and cutoutRight
var changes = combinedShadeHeadersConstraintManager
.edgesGuidelinesConstraints(
- if (view.isLayoutRtl) cutoutRight else cutoutLeft,
+ (if (view.isLayoutRtl) cutoutRight else cutoutLeft) + statusBarPaddingStart,
header.paddingStart,
- if (view.isLayoutRtl) cutoutLeft else cutoutRight,
+ (if (view.isLayoutRtl) cutoutLeft else cutoutRight) + statusBarPaddingEnd,
header.paddingEnd
)
@@ -486,7 +491,6 @@ class LargeScreenShadeHeaderController @Inject constructor(
}
private fun updateResources() {
- roundedCorners = resources.getDimensionPixelSize(R.dimen.rounded_corner_content_padding)
val padding = resources.getDimensionPixelSize(R.dimen.qs_panel_padding)
header.setPadding(padding, header.paddingTop, padding, header.paddingBottom)
updateQQSPaddings()
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java
index 7b6fc66a208d..ab919f4c5882 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java
@@ -164,14 +164,7 @@ public class KeyguardStatusBarView extends RelativeLayout {
mCarrierLabel.setTextSize(TypedValue.COMPLEX_UNIT_PX,
getResources().getDimensionPixelSize(
com.android.internal.R.dimen.text_size_small_material));
- lp = (MarginLayoutParams) mCarrierLabel.getLayoutParams();
- int marginStart = calculateMargin(
- getResources().getDimensionPixelSize(R.dimen.keyguard_carrier_text_margin),
- mPadding.first);
- lp.setMarginStart(marginStart);
-
- mCarrierLabel.setLayoutParams(lp);
updateKeyguardStatusBarHeight();
}
--
2.34.1

View File

@ -1,128 +0,0 @@
From f6022c3e0b759dbcbe8ef750db0f83f1e244ff33 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Thu, 29 Dec 2022 02:53:16 +0000
Subject: [PATCH 09/21] Revert "SystemUI: Align QS header with status bar"
This reverts commit 8658042a3c1c662f6a14ea3bf311e1e6b07f785e.
---
.../res/layout/quick_qs_status_icons.xml | 3 +++
.../quick_status_bar_header_date_privacy.xml | 4 +++-
.../systemui/qs/QuickStatusBarHeader.java | 23 ++++++++-----------
3 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/packages/SystemUI/res/layout/quick_qs_status_icons.xml b/packages/SystemUI/res/layout/quick_qs_status_icons.xml
index 9feec09dd52a..7a370d8cbc48 100644
--- a/packages/SystemUI/res/layout/quick_qs_status_icons.xml
+++ b/packages/SystemUI/res/layout/quick_qs_status_icons.xml
@@ -21,6 +21,7 @@
android:layout_height="@*android:dimen/quick_qs_offset_height"
android:clipChildren="false"
android:clipToPadding="false"
+ android:minHeight="@dimen/qs_header_row_min_height"
android:clickable="false"
android:focusable="true"
android:theme="@style/QSHeaderTheme">
@@ -38,6 +39,7 @@
android:id="@+id/clock"
android:layout_width="wrap_content"
android:layout_height="match_parent"
+ android:minHeight="@dimen/qs_header_row_min_height"
android:gravity="center_vertical|start"
android:paddingStart="@dimen/status_bar_left_clock_starting_padding"
android:paddingEnd="@dimen/status_bar_left_clock_end_padding"
@@ -62,6 +64,7 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
+ android:minHeight="@dimen/qs_header_row_min_height"
android:minWidth="48dp"
android:layout_marginStart="8dp"
android:layout_gravity="end|center_vertical"
diff --git a/packages/SystemUI/res/layout/quick_status_bar_header_date_privacy.xml b/packages/SystemUI/res/layout/quick_status_bar_header_date_privacy.xml
index 2220bbbb76a5..60bc3732cde0 100644
--- a/packages/SystemUI/res/layout/quick_status_bar_header_date_privacy.xml
+++ b/packages/SystemUI/res/layout/quick_status_bar_header_date_privacy.xml
@@ -25,12 +25,14 @@
android:gravity="center"
android:layout_gravity="top"
android:orientation="horizontal"
- android:clickable="true">
+ android:clickable="true"
+ android:minHeight="48dp">
<FrameLayout
android:id="@+id/date_container"
android:layout_width="0dp"
android:layout_height="match_parent"
+ android:minHeight="48dp"
android:layout_weight="1"
android:gravity="center_vertical|start" >
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java b/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
index efa864f12481..b0e2f8368703 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
@@ -105,7 +105,6 @@ public class QuickStatusBarHeader extends FrameLayout implements TunerService.Tu
private StatusBarContentInsetsProvider mInsetsProvider;
private int mRoundedCornerPadding = 0;
- private int mStatusBarPaddingTop;
private int mWaterfallTopInset;
private int mCutOutPaddingLeft;
private int mCutOutPaddingRight;
@@ -267,20 +266,19 @@ public class QuickStatusBarHeader extends FrameLayout implements TunerService.Tu
mRoundedCornerPadding = resources.getDimensionPixelSize(
R.dimen.rounded_corner_content_padding);
- int statusBarHeight = SystemBarUtils.getStatusBarHeight(mContext);
+ int qsOffsetHeight = SystemBarUtils.getQuickQsOffsetHeight(mContext);
- mStatusBarPaddingTop = resources.getDimensionPixelSize(
- R.dimen.status_bar_padding_top);
-
- mDatePrivacyView.getLayoutParams().height = statusBarHeight;
+ mDatePrivacyView.getLayoutParams().height =
+ Math.max(qsOffsetHeight, mDatePrivacyView.getMinimumHeight());
mDatePrivacyView.setLayoutParams(mDatePrivacyView.getLayoutParams());
- mStatusIconsView.getLayoutParams().height = statusBarHeight;
+ mStatusIconsView.getLayoutParams().height =
+ Math.max(qsOffsetHeight, mStatusIconsView.getMinimumHeight());
mStatusIconsView.setLayoutParams(mStatusIconsView.getLayoutParams());
ViewGroup.LayoutParams lp = getLayoutParams();
if (mQsDisabled) {
- lp.height = mStatusIconsView.getLayoutParams().height - mWaterfallTopInset;
+ lp.height = mStatusIconsView.getLayoutParams().height;
} else {
lp.height = WRAP_CONTENT;
}
@@ -304,9 +302,8 @@ public class QuickStatusBarHeader extends FrameLayout implements TunerService.Tu
}
MarginLayoutParams qqsLP = (MarginLayoutParams) mHeaderQsPanel.getLayoutParams();
- qqsLP.topMargin = largeScreenHeaderActive || !mUseCombinedQSHeader
- ? mContext.getResources().getDimensionPixelSize(R.dimen.qqs_layout_margin_top)
- : SystemBarUtils.getQuickQsOffsetHeight(mContext);
+ qqsLP.topMargin = largeScreenHeaderActive || !mUseCombinedQSHeader ? mContext.getResources()
+ .getDimensionPixelSize(R.dimen.qqs_layout_margin_top) : qsOffsetHeight;
mHeaderQsPanel.setLayoutParams(qqsLP);
updateBatteryMode();
@@ -553,11 +550,11 @@ public class QuickStatusBarHeader extends FrameLayout implements TunerService.Tu
}
mDatePrivacyView.setPadding(paddingLeft,
- mStatusBarPaddingTop,
+ mWaterfallTopInset,
paddingRight,
0);
mStatusIconsView.setPadding(paddingLeft,
- mStatusBarPaddingTop,
+ mWaterfallTopInset,
paddingRight,
0);
}
--
2.25.1

View File

@ -1,263 +0,0 @@
From 808ad70d1c92dfc1ac6b6e665b826504a760b88c Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sat, 20 Mar 2021 10:35:14 +0000
Subject: [PATCH 10/21] Keyguard/UI: Fix status bar / quick settings margins
and paddings
Last revised on 2022/09/24, targeting T
The way I think SB/QS margins/paddings should work:
- Devices with left notch: [notch_definition][status_bar_padding_start][content]...[content][status_bar_padding_end][rounded_corner_content_padding]
- Devices with center or no notch: [rounded_corner_content_padding][status_bar_padding_start][content]...[content][status_bar_padding_end][rounded_corner_content_padding]
Key point being:
- SB (including keyguard) and QS should always act uniformly
- Notch definition should only be the notch itself, without additional padding
- Instead, these paddings should be covered by status_bar_padding_{start|end}
As a result, below changes have been made:
- Change keyguard_carrier_text_margin into a padding
- Link keyguard paddings to status_bar_padding_{start|end}
- Add status_bar_padding_{start|end} to quick settings header
- Remove several unnecessary margins and paddings
- Animate padding for new QS clock in s-qpr1
Change-Id: Ic91fa398813e1907297bb0892c444d96405950e7
---
.../res/layout/keyguard_status_bar.xml | 2 +-
.../res/layout/quick_qs_status_icons.xml | 6 ---
.../quick_status_bar_header_date_privacy.xml | 5 +-
.../SystemUI/res/values-sw600dp/dimens.xml | 3 --
packages/SystemUI/res/values/dimens.xml | 2 +-
.../systemui/qs/QuickStatusBarHeader.java | 50 ++++++++++++-------
.../phone/KeyguardStatusBarView.java | 7 ---
7 files changed, 35 insertions(+), 40 deletions(-)
diff --git a/packages/SystemUI/res/layout/keyguard_status_bar.xml b/packages/SystemUI/res/layout/keyguard_status_bar.xml
index 2480d0189e16..5561271d4733 100644
--- a/packages/SystemUI/res/layout/keyguard_status_bar.xml
+++ b/packages/SystemUI/res/layout/keyguard_status_bar.xml
@@ -86,7 +86,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="@dimen/status_bar_padding_top"
- android:layout_marginStart="@dimen/keyguard_carrier_text_margin"
+ android:paddingStart="@dimen/keyguard_carrier_text_margin"
android:layout_toStartOf="@id/system_icons_container"
android:gravity="center_vertical"
android:ellipsize="marquee"
diff --git a/packages/SystemUI/res/layout/quick_qs_status_icons.xml b/packages/SystemUI/res/layout/quick_qs_status_icons.xml
index 7a370d8cbc48..0247eebea131 100644
--- a/packages/SystemUI/res/layout/quick_qs_status_icons.xml
+++ b/packages/SystemUI/res/layout/quick_qs_status_icons.xml
@@ -21,7 +21,6 @@
android:layout_height="@*android:dimen/quick_qs_offset_height"
android:clipChildren="false"
android:clipToPadding="false"
- android:minHeight="@dimen/qs_header_row_min_height"
android:clickable="false"
android:focusable="true"
android:theme="@style/QSHeaderTheme">
@@ -39,10 +38,7 @@
android:id="@+id/clock"
android:layout_width="wrap_content"
android:layout_height="match_parent"
- android:minHeight="@dimen/qs_header_row_min_height"
android:gravity="center_vertical|start"
- android:paddingStart="@dimen/status_bar_left_clock_starting_padding"
- android:paddingEnd="@dimen/status_bar_left_clock_end_padding"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.QS.Status" />
@@ -50,7 +46,6 @@
android:id="@+id/date_clock"
android:layout_width="wrap_content"
android:layout_height="match_parent"
- android:layout_marginStart="@dimen/status_bar_left_clock_end_padding"
android:gravity="center_vertical|start"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.QS.Status"
@@ -64,7 +59,6 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
- android:minHeight="@dimen/qs_header_row_min_height"
android:minWidth="48dp"
android:layout_marginStart="8dp"
android:layout_gravity="end|center_vertical"
diff --git a/packages/SystemUI/res/layout/quick_status_bar_header_date_privacy.xml b/packages/SystemUI/res/layout/quick_status_bar_header_date_privacy.xml
index 60bc3732cde0..6ba9382bea94 100644
--- a/packages/SystemUI/res/layout/quick_status_bar_header_date_privacy.xml
+++ b/packages/SystemUI/res/layout/quick_status_bar_header_date_privacy.xml
@@ -25,14 +25,12 @@
android:gravity="center"
android:layout_gravity="top"
android:orientation="horizontal"
- android:clickable="true"
- android:minHeight="48dp">
+ android:clickable="true">
<FrameLayout
android:id="@+id/date_container"
android:layout_width="0dp"
android:layout_height="match_parent"
- android:minHeight="48dp"
android:layout_weight="1"
android:gravity="center_vertical|start" >
@@ -64,7 +62,6 @@
android:id="@+id/privacy_container"
android:layout_width="0dp"
android:layout_height="match_parent"
- android:minHeight="48dp"
android:layout_weight="1"
android:gravity="center_vertical|end" >
diff --git a/packages/SystemUI/res/values-sw600dp/dimens.xml b/packages/SystemUI/res/values-sw600dp/dimens.xml
index 599bf30a5135..f9911fda7dbe 100644
--- a/packages/SystemUI/res/values-sw600dp/dimens.xml
+++ b/packages/SystemUI/res/values-sw600dp/dimens.xml
@@ -27,9 +27,6 @@
<!-- The width of user avatar when on Keyguard -->
<dimen name="multi_user_avatar_keyguard_size">30dp</dimen>
- <!-- Margin on the left side of the carrier text on Keyguard -->
- <dimen name="keyguard_carrier_text_margin">24dp</dimen>
-
<!-- The width/height of the phone/camera/unlock icon on keyguard. -->
<dimen name="keyguard_affordance_height">80dp</dimen>
<dimen name="keyguard_affordance_width">120dp</dimen>
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 44766f3b6a6d..569926a1e1a0 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -736,7 +736,7 @@
<dimen name="kg_framed_avatar_size">32dp</dimen>
<!-- Margin on the left side of the carrier text on Keyguard -->
- <dimen name="keyguard_carrier_text_margin">16dp</dimen>
+ <dimen name="keyguard_carrier_text_margin">@dimen/status_bar_padding_start</dimen>
<!-- Additional translation (downwards) for appearing notifications when going to the full shade
from Keyguard. -->
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java b/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
index b0e2f8368703..4ff7e5753a1d 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
@@ -105,6 +105,10 @@ public class QuickStatusBarHeader extends FrameLayout implements TunerService.Tu
private StatusBarContentInsetsProvider mInsetsProvider;
private int mRoundedCornerPadding = 0;
+ private int mStatusBarPaddingStart;
+ private int mStatusBarPaddingEnd;
+ private int mHeaderPaddingLeft;
+ private int mHeaderPaddingRight;
private int mWaterfallTopInset;
private int mCutOutPaddingLeft;
private int mCutOutPaddingRight;
@@ -266,6 +270,11 @@ public class QuickStatusBarHeader extends FrameLayout implements TunerService.Tu
mRoundedCornerPadding = resources.getDimensionPixelSize(
R.dimen.rounded_corner_content_padding);
+ mStatusBarPaddingStart = resources.getDimensionPixelSize(
+ R.dimen.status_bar_padding_start);
+ mStatusBarPaddingEnd = resources.getDimensionPixelSize(
+ R.dimen.status_bar_padding_end);
+
int qsOffsetHeight = SystemBarUtils.getQuickQsOffsetHeight(mContext);
mDatePrivacyView.getLayoutParams().height =
@@ -356,6 +365,9 @@ public class QuickStatusBarHeader extends FrameLayout implements TunerService.Tu
.addFloat(mDateView, "alpha", 0, 0, 1)
.addFloat(mClockDateView, "alpha", 1, 0, 0)
.addFloat(mQSCarriers, "alpha", 0, 1)
+ // Use statusbar paddings when collapsed, align with QS when expanded, and animate translation
+ .addFloat(mClockContainer, "translationX", mHeaderPaddingLeft + mStatusBarPaddingStart, 0)
+ .addFloat(mRightLayout, "translationX", -(mHeaderPaddingRight + mStatusBarPaddingEnd), 0)
.setListener(new TouchAnimator.ListenerAdapter() {
@Override
public void onAnimationAtEnd() {
@@ -463,8 +475,6 @@ public class QuickStatusBarHeader extends FrameLayout implements TunerService.Tu
.getStatusBarContentInsetsForCurrentRotation();
boolean hasCornerCutout = mInsetsProvider.currentRotationHasCornerCutout();
- mDatePrivacyView.setPadding(sbInsets.first, 0, sbInsets.second, 0);
- mStatusIconsView.setPadding(sbInsets.first, 0, sbInsets.second, 0);
LinearLayout.LayoutParams datePrivacySeparatorLayoutParams =
(LinearLayout.LayoutParams) mDatePrivacySeparator.getLayoutParams();
LinearLayout.LayoutParams mClockIconsSeparatorLayoutParams =
@@ -528,34 +538,38 @@ public class QuickStatusBarHeader extends FrameLayout implements TunerService.Tu
private void updateHeadersPadding() {
setContentMargins(mDatePrivacyView, 0, 0);
setContentMargins(mStatusIconsView, 0, 0);
- int paddingLeft = 0;
- int paddingRight = 0;
FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) getLayoutParams();
+ // Note: these are supposedly notification_side_paddings
int leftMargin = lp.leftMargin;
int rightMargin = lp.rightMargin;
// The clock might collide with cutouts, let's shift it out of the way.
- // We only do that if the inset is bigger than our own padding, since it's nicer to
- // align with
- if (mCutOutPaddingLeft > 0) {
- // if there's a cutout, let's use at least the rounded corner inset
- int cutoutPadding = Math.max(mCutOutPaddingLeft, mRoundedCornerPadding);
- paddingLeft = Math.max(cutoutPadding - leftMargin, 0);
+ // Margin will be the reference point of paddings/translations
+ // and will have to be subtracted from cutout paddings
+ boolean headerPaddingUpdated = false;
+ int headerPaddingLeft = Math.max(mCutOutPaddingLeft, mRoundedCornerPadding) - leftMargin;
+ if (headerPaddingLeft != mHeaderPaddingLeft) {
+ mHeaderPaddingLeft = headerPaddingLeft;
+ headerPaddingUpdated = true;
}
- if (mCutOutPaddingRight > 0) {
- // if there's a cutout, let's use at least the rounded corner inset
- int cutoutPadding = Math.max(mCutOutPaddingRight, mRoundedCornerPadding);
- paddingRight = Math.max(cutoutPadding - rightMargin, 0);
+ int headerPaddingRight = Math.max(mCutOutPaddingRight, mRoundedCornerPadding) - rightMargin;
+ if (headerPaddingRight != mHeaderPaddingRight) {
+ mHeaderPaddingRight = headerPaddingRight;
+ headerPaddingUpdated = true;
}
- mDatePrivacyView.setPadding(paddingLeft,
+ // Update header animator with new paddings
+ if (headerPaddingUpdated) {
+ updateAnimators();
+ }
+ mDatePrivacyView.setPadding(mHeaderPaddingLeft + mStatusBarPaddingStart,
mWaterfallTopInset,
- paddingRight,
+ mHeaderPaddingRight + mStatusBarPaddingEnd,
0);
- mStatusIconsView.setPadding(paddingLeft,
+ mStatusIconsView.setPadding(0,
mWaterfallTopInset,
- paddingRight,
+ 0,
0);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java
index 5119b8f95aa8..090fa7aac340 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java
@@ -156,14 +156,7 @@ public class KeyguardStatusBarView extends RelativeLayout {
mCarrierLabel.setTextSize(TypedValue.COMPLEX_UNIT_PX,
getResources().getDimensionPixelSize(
com.android.internal.R.dimen.text_size_small_material));
- lp = (MarginLayoutParams) mCarrierLabel.getLayoutParams();
- int marginStart = calculateMargin(
- getResources().getDimensionPixelSize(R.dimen.keyguard_carrier_text_margin),
- mPadding.first);
- lp.setMarginStart(marginStart);
-
- mCarrierLabel.setLayoutParams(lp);
updateKeyguardStatusBarHeight();
}
--
2.25.1

View File

@ -1,7 +1,7 @@
From 2f26229212e75def4f1072c5aaf05bf392007383 Mon Sep 17 00:00:00 2001
From a893877e865d6c39bf6f7976efe5618787a1a15f Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 17 Apr 2022 08:48:42 +0000
Subject: [PATCH 11/21] Replace NTP server
Subject: [PATCH 10/21] Replace NTP server
Change-Id: I938ab46026d841e7536d8fc02b0ef6b28ebb6ea1
---
@ -9,10 +9,10 @@ Change-Id: I938ab46026d841e7536d8fc02b0ef6b28ebb6ea1
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 58cd819b9404..285a72320eee 100644
index 8f81427cbe67..8bd2f7aaad07 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -2390,7 +2390,7 @@
@@ -2416,7 +2416,7 @@
<bool name="config_actionMenuItemAllCaps">true</bool>
<!-- Remote server that can provide NTP responses. -->
@ -22,5 +22,5 @@ index 58cd819b9404..285a72320eee 100644
<integer name="config_ntpPollingInterval">64800000</integer>
<!-- Try-again polling interval in milliseconds, in case the network request failed -->
--
2.25.1
2.34.1

View File

@ -1,7 +1,7 @@
From dd9133c4af60b222e4f09a430ef120accefb1f93 Mon Sep 17 00:00:00 2001
From ce6bd2ce984f6647b673640dc4bbd07315fb128b Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Tue, 31 May 2022 00:00:08 +0000
Subject: [PATCH 12/21] Revert "SystemUI: Add left padding for keyguard slices"
Subject: [PATCH 11/21] Revert "SystemUI: Add left padding for keyguard slices"
This reverts commit 4a7a4426944e28e70a3eca6a696ff6c7599fb896.
---
@ -40,5 +40,5 @@ index 31d22eb38a24..65a71664e245 100644
@Override
--
2.25.1
2.34.1

View File

@ -1,7 +1,7 @@
From 90b961d665973de20d59218fafcefca48f92d5b1 Mon Sep 17 00:00:00 2001
From 1476a09fe1f6d1facfeff4fe1f4bfba02f34a176 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 5 Sep 2021 01:20:12 +0000
Subject: [PATCH 13/21] Revert "Update RAT icons to match Silk design"
Subject: [PATCH 12/21] Revert "Update RAT icons to match Silk design"
This reverts commit 084c13c8216f6a899cd3eda04fc1d7acff3d1248.
---
@ -269,5 +269,5 @@ index 48faeb22416f..1511659ea42f 100644
+ android:pathData="M14.21,12.81c0.36,-0.16 0.69,-0.36 0.97,-0.61c0.41,-0.38 0.72,-0.83 0.94,-1.37c0.21,-0.54 0.32,-1.14 0.32,-1.79c0,-0.92 -0.16,-1.7 -0.49,-2.33c-0.32,-0.64 -0.79,-1.12 -1.43,-1.45c-0.62,-0.33 -1.4,-0.49 -2.32,-0.49H8.23V19h1.8v-5.76h2.5L15.06,19h1.92v-0.12L14.21,12.81zM10.03,11.71V6.32h2.18c0.59,0 1.06,0.11 1.42,0.34c0.36,0.22 0.62,0.54 0.78,0.95c0.16,0.41 0.24,0.89 0.24,1.44c0,0.49 -0.09,0.93 -0.27,1.34c-0.18,0.4 -0.46,0.73 -0.82,0.97c-0.36,0.23 -0.82,0.35 -1.37,0.35H10.03z"/>
</vector>
--
2.25.1
2.34.1

View File

@ -1,7 +1,7 @@
From b96671ae18db307e2f4323132967544ff66d97ce Mon Sep 17 00:00:00 2001
From 0e336e834bf43aec2c3d627140e6b6f9a5466580 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Thu, 29 Sep 2022 11:27:57 +0000
Subject: [PATCH 14/21] Revert "Use the default top clock margin on h800
Subject: [PATCH 13/21] Revert "Use the default top clock margin on h800
devices"
This reverts commits 50ba380f4d8d1c2523e0f76295ca556038796bfd
@ -11,7 +11,7 @@ and 2a254b4d479029aec46f79a0ed14ffab6d0424bc.
1 file changed, 3 insertions(+)
diff --git a/packages/SystemUI/res/values-h800dp/dimens.xml b/packages/SystemUI/res/values-h800dp/dimens.xml
index 94fe20955ce6..1d6f279afc66 100644
index 3a71994e07e2..4b9bce0eda99 100644
--- a/packages/SystemUI/res/values-h800dp/dimens.xml
+++ b/packages/SystemUI/res/values-h800dp/dimens.xml
@@ -15,6 +15,9 @@
@ -21,9 +21,9 @@ index 94fe20955ce6..1d6f279afc66 100644
+ <!-- Minimum margin between clock and top of screen or ambient indication -->
+ <dimen name="keyguard_clock_top_margin">38dp</dimen>
+
<!-- Large clock maximum font size (dp is intentional, to prevent any further scaling) -->
<dimen name="large_clock_text_size">200dp</dimen>
<!-- With the large clock, move up slightly from the center -->
<dimen name="keyguard_large_clock_top_margin">-112dp</dimen>
--
2.25.1
2.34.1

View File

@ -1,7 +1,7 @@
From 6b1e1b06f33f3fe3d0f5a5f6aaa8b9d6bdfbbe01 Mon Sep 17 00:00:00 2001
From d4aeaae7ab4d7c2e51b86afd6fa12888a47be51a Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Wed, 7 Oct 2020 14:00:35 +0000
Subject: [PATCH 15/21] UI: Always render windows into cutouts
Subject: [PATCH 14/21] UI: Always render windows into cutouts
Eliminates black/white letterboxing
Quick and dirty way to do the latter - wait for proper fix from Google
@ -52,10 +52,10 @@ index 33641f72b2ff..6e201970ac03 100644
}
diff --git a/services/core/java/com/android/server/wm/DisplayPolicy.java b/services/core/java/com/android/server/wm/DisplayPolicy.java
index f4cb23d5f369..a4cd2fbcc89f 100644
index ebeb189000a3..5c4cde643e82 100644
--- a/services/core/java/com/android/server/wm/DisplayPolicy.java
+++ b/services/core/java/com/android/server/wm/DisplayPolicy.java
@@ -1639,6 +1639,7 @@ public class DisplayPolicy {
@@ -1550,6 +1550,7 @@ public class DisplayPolicy {
displayFrames = win.getDisplayFrames(displayFrames);
final WindowManager.LayoutParams attrs = win.mAttrs.forRotation(displayFrames.mRotation);
@ -64,5 +64,5 @@ index f4cb23d5f369..a4cd2fbcc89f 100644
// If this window has different LayoutParams for rotations, we cannot trust its requested
--
2.25.1
2.34.1

View File

@ -1,7 +1,7 @@
From b4d980d9f9421f8043edf7e4eda459f40486d09e Mon Sep 17 00:00:00 2001
From 4565707ddbfac766a60fa90ed6c68e31badfbad3 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Wed, 1 Sep 2021 14:10:50 +0000
Subject: [PATCH 16/21] UI: Kill rounded corners in notification scrim
Subject: [PATCH 15/21] UI: Kill rounded corners in notification scrim
Rounded corners in S is nicely implemented, but this is one occasion where it looks out of place
@ -11,10 +11,10 @@ Change-Id: I09ed59e0e658ebd512a9d02a8ef3edfe2c9888da
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 569926a1e1a0..09dd8ed9ef9d 100644
index b5854568c117..1d6a7dd284a5 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -672,7 +672,7 @@
@@ -684,7 +684,7 @@
<!-- With the large clock, move up slightly from the center -->
<dimen name="keyguard_large_clock_top_margin">-60dp</dimen>
@ -24,5 +24,5 @@ index 569926a1e1a0..09dd8ed9ef9d 100644
<!-- The minimum amount the user needs to swipe to go to the camera / phone. -->
<dimen name="keyguard_min_swipe_amount">110dp</dimen>
--
2.25.1
2.34.1

View File

@ -1,7 +1,7 @@
From 7b78452e09b2f142c9b6ae23dfab058da7bdb03e Mon Sep 17 00:00:00 2001
From c8eb0353820700a61178af90e221db5cc7ffb3e5 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Mon, 26 Oct 2020 14:06:56 +0000
Subject: [PATCH 17/21] UI: Reconfigure power menu items
Subject: [PATCH 16/21] UI: Reconfigure power menu items
Change-Id: I32cca6e2c6bb64d891efee959127edf7c0802cbc
---
@ -9,10 +9,10 @@ Change-Id: I32cca6e2c6bb64d891efee959127edf7c0802cbc
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 285a72320eee..828090c2ccda 100644
index 8bd2f7aaad07..a2df7afe944c 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -3213,13 +3213,10 @@
@@ -3252,13 +3252,10 @@
"logout" = Logout the current user
-->
<string-array translatable="false" name="config_globalActionsList">
@ -28,5 +28,5 @@ index 285a72320eee..828090c2ccda 100644
<!-- Number of milliseconds to hold a wake lock to ensure that drawing is fully
--
2.25.1
2.34.1

View File

@ -1,7 +1,7 @@
From a72959c54bab273faf23b111b3c2ea37a05ebf1e Mon Sep 17 00:00:00 2001
From 87c266fe66b62ac138f9c1dbbc5bc0339a67526e Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sat, 5 Mar 2022 01:43:37 +0000
Subject: [PATCH 18/21] UI: Reconfigure quick settings tiles
Subject: [PATCH 17/21] UI: Reconfigure quick settings tiles
Change-Id: I743f52ef3a95db0ca2c02ae973faa4629e41885d
---
@ -9,7 +9,7 @@ Change-Id: I743f52ef3a95db0ca2c02ae973faa4629e41885d
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index 8a2b88d3cf9a..3287463b7bd0 100644
index 70269b18a573..38b654b64418 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -68,7 +68,7 @@
@ -22,5 +22,5 @@ index 8a2b88d3cf9a..3287463b7bd0 100644
<!-- The class path of the Safety Quick Settings Tile -->
--
2.25.1
2.34.1

View File

@ -1,7 +1,7 @@
From 3e220efe0e330611011aae408c7341afb3ca6637 Mon Sep 17 00:00:00 2001
From 15166b73a21dfcd204ed1d5f65934cee1d972be9 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Tue, 29 Jun 2021 22:57:01 +0000
Subject: [PATCH 19/21] UI: Relax requirement for HINT_SUPPORTS_DARK_TEXT
Subject: [PATCH 18/21] UI: Relax requirement for HINT_SUPPORTS_DARK_TEXT
I decide what's good enough for a wallpaper!
@ -24,5 +24,5 @@ index 067a4c3c047e..a8d3c14e1d9d 100644
}
if (meanLuminance < DARK_THEME_MEAN_LUMINANCE) {
--
2.25.1
2.34.1

View File

@ -1,18 +1,24 @@
From a0b674ba56fd96ec0f732f587fb5b0b975d01a1a Mon Sep 17 00:00:00 2001
From 0ee6fdb253b5568408387a8f1348d4daa790e8e5 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Tue, 19 Oct 2021 12:09:34 +0000
Subject: [PATCH 20/21] UI: Remove privacy dot padding
Subject: [PATCH 19/21] UI: Remove privacy dot
Change-Id: I5d2e2b3e36f027b4348a83030d4b4d3c4f0209d1
---
packages/SystemUI/res/values/dimens.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
packages/SystemUI/res/values/dimens.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 09dd8ed9ef9d..4515539bb4b4 100644
index 1d6a7dd284a5..0ebbcdb16f79 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -1002,7 +1002,7 @@
@@ -1014,12 +1014,12 @@
<dimen name="ongoing_appops_chip_min_width">56dp</dimen>
<!-- Three privacy items. This value must not be exceeded -->
<dimen name="ongoing_appops_chip_max_width">76dp</dimen>
- <dimen name="ongoing_appops_dot_diameter">6dp</dimen>
+ <dimen name="ongoing_appops_dot_diameter">0dp</dimen>
<dimen name="ongoing_appops_chip_min_animation_width">10dp</dimen>
<dimen name="ongoing_appops_chip_animation_in_status_bar_translation_x">15dp</dimen>
<dimen name="ongoing_appops_chip_animation_out_status_bar_translation_x">7dp</dimen>
<!-- Total minimum padding to enforce to ensure that the dot can always show -->
@ -22,5 +28,5 @@ index 09dd8ed9ef9d..4515539bb4b4 100644
<dimen name="ongoing_appops_dialog_side_margins">@dimen/notification_shade_content_margin_horizontal</dimen>
--
2.25.1
2.34.1

View File

@ -0,0 +1,35 @@
From 3829d2d835c4dee4861e4262424a0540bc57af26 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Wed, 22 Mar 2023 00:29:13 +0000
Subject: [PATCH 20/21] UI: Restore quick settings fonts to pre-T-QPR2
TODO: Large header clock looks better in Regular - perhaps figure out how to transition smoothly?
Change-Id: If2e57fee61b6bd4b6b7fedc7e3011164cd2cb56f
---
packages/SystemUI/res/values/styles.xml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml
index 6c5e6d73feb7..1bbd930443a2 100644
--- a/packages/SystemUI/res/values/styles.xml
+++ b/packages/SystemUI/res/values/styles.xml
@@ -134,7 +134,7 @@
<!-- This is hard coded to be sans-serif-condensed to match the icons -->
<style name="TextAppearance.QS.Status">
- <item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
+ <item name="android:fontFamily">@*android:string/config_headlineFontFamilyMedium</item>
<item name="android:textColor">?android:attr/textColorPrimary</item>
<item name="android:textSize">14sp</item>
<item name="android:letterSpacing">0.01</item>
@@ -152,6 +152,7 @@
</style>
<style name="TextAppearance.QS.Status.Build">
+ <item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
<item name="android:textColor">?android:attr/textColorSecondary</item>
</style>
--
2.34.1

View File

@ -1,4 +1,4 @@
From c3a93b2e23aed8c3f831c0636655dccd80770d45 Mon Sep 17 00:00:00 2001
From 8eb4dba8b771a9f30db4cd58eb7509642568506b Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Fri, 30 Sep 2022 16:02:16 +0000
Subject: [PATCH 21/21] UI: Revert to HSL luminance for wallpaper dark hints
@ -43,5 +43,5 @@ index a8d3c14e1d9d..88609f3d7052 100644
int hints = 0;
--
2.25.1
2.34.1

View File

@ -1,4 +1,4 @@
From d94a28d2f9f88d3fee4f2a71b2364bca23f4be8b Mon Sep 17 00:00:00 2001
From 4c3fbe18f838dce0c06342016ca4c933cf077a05 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 13 Mar 2022 11:22:48 +0000
Subject: [PATCH] Revert "[DO NOT MERGE] Allow a settings override for
@ -19,10 +19,10 @@ Change-Id: I8b4b1354f23981f6edbe7f3c81ec4f511da3cc1a
delete mode 100644 tests/robotests/src/com/android/settings/display/LockscreenClockPreferenceControllerTest.java
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 09d80c8814..8e55b8a4b8 100644
index 62062b5fe8..35a8a39689 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -13520,10 +13520,6 @@
@@ -13812,10 +13812,6 @@
<string name="lockscreen_trivial_controls_summary">Control external devices without unlocking your phone or tablet if allowed by the device controls app</string>
<!-- Trivial Device disabled controls summary [CHAR LIMIT=NONE] -->
<string name="lockscreen_trivial_disabled_controls_summary">To use, first turn on \u0022Show device controls\u0022</string>
@ -30,17 +30,17 @@ index 09d80c8814..8e55b8a4b8 100644
- <string name="lockscreen_double_line_clock_summary">Show double-line clock when available</string>
- <!-- Lockscreen double-line clock toggle [CHAR LIMIT=60] -->
- <string name="lockscreen_double_line_clock_setting_toggle">Double-line clock</string>
<!-- Title for RTT setting. [CHAR LIMIT=NONE] -->
<string name="rtt_settings_title"></string>
<!-- Lock screen shortcuts preference [CHAR LIMIT=60] -->
<string name="lockscreen_quick_affordances_title">Shortcuts</string>
<!-- Summary for the lock screen button preference [CHAR LIMIT=60] -->
diff --git a/res/xml/security_lockscreen_settings.xml b/res/xml/security_lockscreen_settings.xml
index cb3c69172e..3b3635ac45 100644
index 77a32122ee..b71839fe23 100644
--- a/res/xml/security_lockscreen_settings.xml
+++ b/res/xml/security_lockscreen_settings.xml
@@ -78,12 +78,6 @@
android:title="@string/lockscreen_trivial_controls_setting_toggle"
android:summary="@string/lockscreen_trivial_controls_summary"
settings:controller="com.android.settings.display.ControlsTrivialPrivacyPreferenceController"/>
android:key="customizable_lock_screen_quick_affordances"
android:title="@string/lockscreen_quick_affordances_title"
settings:controller="com.android.settings.display.CustomizableLockScreenQuickAffordancesPreferenceController" />
-
- <SwitchPreference
- android:key="lockscreen_double_line_clock_switch"
@ -223,5 +223,5 @@ index 94f2dc6655..0000000000
- }
-}
--
2.25.1
2.34.1

View File

@ -1,7 +1,7 @@
From 51deb8e31ca57f19420277cc92b26375233e9050 Mon Sep 17 00:00:00 2001
From 1ae4e6c6b0af6ed394f5009e950c79bd50a83b7c Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Thu, 18 Aug 2022 15:44:46 -0400
Subject: [PATCH 1/5] APM: Restore S, R and Q behavior respectively for
Subject: [PATCH 1/3] APM: Restore S, R and Q behavior respectively for
telephony audio
This conditionally reverts part of b2e5cb (T), 51c9cc (S) and afd4ce (R)
@ -31,12 +31,12 @@ relying on the value of `ro.vndk.version`.
Change-Id: I56d36d2aef4319935cb88a3e4771b23c6d5b2145
---
.../managerdefault/AudioPolicyManager.cpp | 193 +++++++++++++-----
.../managerdefault/AudioPolicyManager.cpp | 197 +++++++++++++-----
.../managerdefault/AudioPolicyManager.h | 3 +
2 files changed, 141 insertions(+), 55 deletions(-)
2 files changed, 143 insertions(+), 57 deletions(-)
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
index 744609f27b..224dae3820 100644
index 4573382a06..b7d0dbcca4 100644
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
@@ -675,6 +675,17 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
@ -148,10 +148,10 @@ index 744609f27b..224dae3820 100644
bool AudioPolicyManager::isDeviceOfModule(
const sp<DeviceDescriptor>& devDesc, const char *moduleId) const {
sp<HwModule> module = mHwModules.getModuleFromName(moduleId);
@@ -4520,76 +4584,95 @@ status_t AudioPolicyManager::createAudioPatchInternal(const struct audio_patch *
@@ -4541,78 +4605,97 @@ status_t AudioPolicyManager::createAudioPatchInternal(const struct audio_patch *
// in config XML to reach the sink so that is can be declared as available.
audio_io_handle_t output = AUDIO_IO_HANDLE_NONE;
sp<SwAudioOutputDescriptor> outputDesc = nullptr;
sp<SwAudioOutputDescriptor> outputDesc;
- if (!sourceDesc->isInternal()) {
- // take care of dynamic routing for SwOutput selection,
- audio_attributes_t attributes = sourceDesc->attributes();
@ -180,10 +180,25 @@ index 744609f27b..224dae3820 100644
- ALOGE("%s output is duplicated", __func__);
- return INVALID_OPERATION;
- }
- sourceDesc->setSwOutput(outputDesc);
- bool closeOutput = outputDesc->mDirectOpenCount != 0;
- sourceDesc->setSwOutput(outputDesc, closeOutput);
- } else {
- // Same for "raw patches" aka created from createAudioPatch API
- SortedVector<audio_io_handle_t> outputs =
- getOutputsForDevices(DeviceVector(sinkDevice), mOutputs);
- // if the sink device is reachable via an opened output stream, request to
- // go via this output stream by adding a second source to the patch
- // description
- output = selectOutput(outputs);
- if (output == AUDIO_IO_HANDLE_NONE) {
- ALOGE("%s no output available for internal patch sink", __func__);
- return INVALID_OPERATION;
- }
- outputDesc = mOutputs.valueFor(output);
- if (outputDesc->isDuplicated()) {
- ALOGV("%s output for device %s is duplicated",
- __func__, sinkDevice->toString().c_str());
- return INVALID_OPERATION;
+ if (sourceDesc != nullptr) {
+ if (!sourceDesc->isInternal()) {
+ // take care of dynamic routing for SwOutput selection,
@ -213,24 +228,12 @@ index 744609f27b..224dae3820 100644
+ ALOGE("%s output is duplicated", __func__);
+ return INVALID_OPERATION;
+ }
+ sourceDesc->setSwOutput(outputDesc);
+ bool closeOutput = outputDesc->mDirectOpenCount != 0;
+ sourceDesc->setSwOutput(outputDesc, closeOutput);
+ } else {
+ // Same for "raw patches" aka created from createAudioPatch API
+ SortedVector<audio_io_handle_t> outputs =
getOutputsForDevices(DeviceVector(sinkDevice), mOutputs);
- // if the sink device is reachable via an opened output stream, request to
- // go via this output stream by adding a second source to the patch
- // description
- output = selectOutput(outputs);
- if (output == AUDIO_IO_HANDLE_NONE) {
- ALOGE("%s no output available for internal patch sink", __func__);
- return INVALID_OPERATION;
- }
- outputDesc = mOutputs.valueFor(output);
- if (outputDesc->isDuplicated()) {
- ALOGV("%s output for device %s is duplicated",
- __func__, sinkDevice->toString().c_str());
- return INVALID_OPERATION;
+ getOutputsForDevices(DeviceVector(sinkDevice), mOutputs);
+ // if the sink device is reachable via an opened output stream, request to
+ // go via this output stream by adding a second source to the patch
+ // description
@ -245,9 +248,9 @@ index 744609f27b..224dae3820 100644
+ __func__, sinkDevice->toString().c_str());
+ return INVALID_OPERATION;
+ }
+ sourceDesc->setSwOutput(outputDesc);
+ sourceDesc->setSwOutput(outputDesc, /* closeOutput= */ false);
}
- sourceDesc->setSwOutput(outputDesc);
- sourceDesc->setSwOutput(outputDesc, /* closeOutput= */ false);
}
// create a software bridge in PatchPanel if:
// - source and sink devices are on different HW modules OR
@ -289,16 +292,17 @@ index 744609f27b..224dae3820 100644
audio_port_config srcMixPortConfig = {};
outputDesc->toAudioPortConfig(&srcMixPortConfig, nullptr);
// for volume control, we may need a valid stream
- srcMixPortConfig.ext.mix.usecase.stream = !sourceDesc->isInternal() ?
+ srcMixPortConfig.ext.mix.usecase.stream = (sourceDesc != nullptr && !sourceDesc->isInternal()) ?
srcMixPortConfig.ext.mix.usecase.stream =
- (!sourceDesc->isInternal() || isCallTxAudioSource(sourceDesc)) ?
+ (sourceDesc != nullptr && (!sourceDesc->isInternal() || isCallTxAudioSource(sourceDesc))) ?
mEngine->getStreamTypeForAttributes(sourceDesc->attributes()) :
AUDIO_STREAM_PATCH;
patchBuilder.addSource(srcMixPortConfig);
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.h b/services/audiopolicy/managerdefault/AudioPolicyManager.h
index db0ee15de8..97fa6f6f81 100644
index a69e08871b..f8762016db 100644
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.h
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.h
@@ -938,6 +938,9 @@ protected:
@@ -944,6 +944,9 @@ protected:
SoundTriggerSessionCollection mSoundTriggerSessions;
@ -309,5 +313,5 @@ index db0ee15de8..97fa6f6f81 100644
SourceClientCollection mAudioSources;
--
2.37.2
2.34.1

View File

@ -1,7 +1,7 @@
From 5def9ad1a26e28d517666e34301dc725c1660e36 Mon Sep 17 00:00:00 2001
From 80d395514dc245fb27204d31075af7145e763723 Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Wed, 24 Aug 2022 15:42:39 -0400
Subject: [PATCH 2/5] APM: Optionally force-load audio policy for system-side
Subject: [PATCH 2/3] APM: Optionally force-load audio policy for system-side
bt audio HAL
Required to support our system-side bt audio implementation, i.e.
@ -57,5 +57,5 @@ index d446e9667b..f5233f2a42 100644
// Global Configuration
--
2.37.2
2.34.1

View File

@ -1,7 +1,7 @@
From e31fc6f3f79848e6f7e7b1b4abe82aa26571cf7b Mon Sep 17 00:00:00 2001
From 02eb4803499890a0cba2f6dfc7bfa5a03d043dd2 Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Thu, 25 Aug 2022 13:30:29 -0400
Subject: [PATCH 3/5] APM: Remove A2DP audio ports from the primary HAL
Subject: [PATCH 3/3] APM: Remove A2DP audio ports from the primary HAL
These ports defined in the primary HAL are intended for A2DP offloading,
however they do not work in general on GSIs, and will interfere with
@ -75,5 +75,5 @@ index f5233f2a42..6630d06f6d 100644
RouteTraits::Collection routes;
--
2.37.2
2.34.1

View File

@ -1,4 +1,4 @@
From 16a004393cddb96e473b86dd891c2e1561813c5d Mon Sep 17 00:00:00 2001
From 3ba16df7f4274056ce2d453ff5064cfdb71b77f6 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Thu, 22 Sep 2022 12:37:50 +0000
Subject: [PATCH 1/8] TrebleSettings: Screen resolution & refresh rate
@ -20,10 +20,10 @@ Change-Id: I4a4679cdb6d4ede55479e9ab2f014342025b0fec
create mode 100644 src/com/android/settings/treble/TrebleSettings.java
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index c4fba3defc..92203f3dab 100644
index 80e0f4b61b..6b138b1f60 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -221,6 +221,14 @@
@@ -223,6 +223,14 @@
android:value="com.android.settings.shortcut.CreateShortcut" />
</activity>
@ -55,7 +55,7 @@ index 0000000000..3c56ed7032
+ android:pathData="M10.82 12.49c.02-.16.04-.32.04-.49 0-.17-.02-.33-.04-.49l1.08-.82c.1-.07.12-.21.06-.32l-1.03-1.73c-.06-.11-.2-.15-.31-.11l-1.28.5c-.27-.2-.56-.36-.87-.49l-.2-1.33c0-.12-.11-.21-.24-.21H5.98c-.13 0-.24.09-.26.21l-.2 1.32c-.31.12-.6.3-.87.49l-1.28-.5c-.12-.05-.25 0-.31.11l-1.03 1.73c-.06.12-.03.25.07.33l1.08.82c-.02.16-.03.33-.03.49 0 .17.02.33.04.49l-1.09.83c-.1.07-.12.21-.06.32l1.03 1.73c.06.11.2.15.31.11l1.28-.5c.27.2.56.36.87.49l.2 1.32c.01.12.12.21.25.21h2.06c.13 0 .24-.09.25-.21l.2-1.32c.31-.12.6-.3.87-.49l1.28.5c.12.05.25 0 .31-.11l1.03-1.73c.06-.11.04-.24-.06-.32l-1.1-.83zM7 13.75c-.99 0-1.8-.78-1.8-1.75s.81-1.75 1.8-1.75 1.8.78 1.8 1.75S8 13.75 7 13.75zM18 1.01L8 1c-1.1 0-2 .9-2 2v3h2V5h10v14H8v-1H6v3c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V3c0-1.1-.9-1.99-2-1.99z"/>
+</vector>
diff --git a/res/values/menu_keys.xml b/res/values/menu_keys.xml
index 2841b699c9..c30d6392e9 100755
index 27e9639122..ef25f9971c 100755
--- a/res/values/menu_keys.xml
+++ b/res/values/menu_keys.xml
@@ -16,6 +16,7 @@
@ -64,13 +64,13 @@ index 2841b699c9..c30d6392e9 100755
+ <string name="menu_key_treble" translatable="false">top_level_treble</string>
<string name="menu_key_network" translatable="false">top_level_network</string>
<string name="menu_key_communal" translatable="false">top_level_communal</string>
<string name="menu_key_connected_devices" translatable="false">top_level_connected_devices</string>
<string name="menu_key_apps" translatable="false">top_level_apps</string>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index bbdefd1427..07ee32662e 100644
index d8a2c3b41c..ae520f9c64 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -8458,6 +8458,16 @@
@@ -8498,6 +8498,16 @@
<item quantity="other">Show %d hidden items</item>
</plurals>
@ -88,7 +88,7 @@ index bbdefd1427..07ee32662e 100644
<string name="network_dashboard_title">Network &amp; internet</string>
<!-- Summary for Network and Internet settings, explaining it contains mobile, wifi setting and data usage settings [CHAR LIMIT=NONE]-->
diff --git a/res/xml/top_level_settings.xml b/res/xml/top_level_settings.xml
index 5fbc7350b8..c63b2114ec 100644
index 8c82b67168..04f763514e 100644
--- a/res/xml/top_level_settings.xml
+++ b/res/xml/top_level_settings.xml
@@ -20,6 +20,15 @@
@ -352,5 +352,5 @@ index 0000000000..e581539229
+
+}
--
2.25.1
2.34.1

View File

@ -1,4 +1,4 @@
From 78583743e42884cf7f94477f08718b6dce63a36a Mon Sep 17 00:00:00 2001
From 7f38cb8576433a221970b5dc3947c7a2bb99595a Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sat, 24 Sep 2022 03:38:41 +0000
Subject: [PATCH 2/8] TrebleSettings: Basic audio and display fixes
@ -21,10 +21,10 @@ Change-Id: I4f22dcd9c59c40b3fd70ba642db35b9466467b7d
create mode 100644 src/com/android/settings/treble/UseAlternativeBacklightScalePreferenceController.java
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 07ee32662e..82ce16483d 100644
index ae520f9c64..df16c68eab 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -8462,11 +8462,19 @@
@@ -8502,11 +8502,19 @@
<string name="treble_settings">Treble settings</string>
<!-- Summary for Treble settings [CHAR LIMIT=NONE]-->
<string name="treble_settings_summary">Fixes &amp; tweaks for GSIs</string>
@ -284,5 +284,5 @@ index 0000000000..bd9de82d90
+
+}
--
2.25.1
2.34.1

View File

@ -1,4 +1,4 @@
From 1ae67d0fba3acd594a161c37a6fbb8dfe9939f0f Mon Sep 17 00:00:00 2001
From 6a913538449ff2097b6f360554f8449ebe781ace Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Tue, 11 Oct 2022 10:29:36 +0000
Subject: [PATCH 3/8] TrebleSettings: IMS
@ -16,10 +16,10 @@ Change-Id: Id7a12e150d4a3dc988f8ce1a888ad88443fa0ea4
create mode 100644 src/com/android/settings/treble/OverrideVolteAvailabilityPreferenceController.java
diff --git a/Android.bp b/Android.bp
index be3a85a43b..5321bd008d 100644
index 0307ccbf82..748b62f520 100644
--- a/Android.bp
+++ b/Android.bp
@@ -92,6 +92,7 @@ android_library {
@@ -93,6 +93,7 @@ android_library {
"LineagePreferenceLib",
"vendor.lineage.fastcharge-V1.0-java",
"SystemUISharedLib",
@ -28,10 +28,10 @@ index be3a85a43b..5321bd008d 100644
libs: [
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 82ce16483d..0350ca6c1b 100644
index df16c68eab..eef415cc89 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -8466,6 +8466,8 @@
@@ -8506,6 +8506,8 @@
<string name="treble_settings_category_name_audio">Audio</string>
<!-- Display category name [CHAR LIMIT=none] -->
<string name="treble_settings_category_name_display">Display</string>
@ -40,7 +40,7 @@ index 82ce16483d..0350ca6c1b 100644
<!-- Treble settings screen, use alternative audio policy title -->
<string name="use_alternative_audio_policy_title">Use alternative audio policy</string>
@@ -8475,6 +8477,13 @@
@@ -8515,6 +8517,13 @@
<string name="screen_resolution_refresh_rate_title">Screen resolution &amp; refresh rate</string>
<!-- Treble settings screen, use alternative backlight scale title -->
<string name="use_alternative_backlight_scale_title">Use alternative backlight scale</string>
@ -386,5 +386,5 @@ index 5c1611c053..50e3eda8c6 100644
}
--
2.25.1
2.34.1

View File

@ -1,4 +1,4 @@
From 0786b6b9b2bda23a4a775ce1afdcc6ae58b20a88 Mon Sep 17 00:00:00 2001
From dd2d72d6b43693ea5c67eef3ab49aae29b63ae8d Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sat, 10 Dec 2022 12:04:37 +0000
Subject: [PATCH 4/8] TrebleSettings: Disable A2DP offload
@ -13,10 +13,10 @@ Change-Id: I737f49d146f83d96793f4436850529e3c528acbe
create mode 100644 src/com/android/settings/treble/DisableA2DPOffloadPreferenceController.java
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 0350ca6c1b..e91a4d36c8 100644
index eef415cc89..bfa28394c7 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -8473,6 +8473,8 @@
@@ -8513,6 +8513,8 @@
<string name="use_alternative_audio_policy_title">Use alternative audio policy</string>
<!-- Treble settings screen, disable soundvolume effect title -->
<string name="disable_soundvolume_effect_title">Disable soundvolume effect</string>
@ -112,5 +112,5 @@ index 50e3eda8c6..5e9b7f88e2 100644
controllers.add(new UseAlternativeBacklightScalePreferenceController(context));
controllers.add(new InstallImsApkPreferenceController(context));
--
2.25.1
2.34.1

View File

@ -1,4 +1,4 @@
From 2576ff07b08ba1395e8d46c2ff34b3660991d330 Mon Sep 17 00:00:00 2001
From ac0bdd1f060115d00762a4d29c214fce2e41e960 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sat, 10 Dec 2022 14:16:50 +0000
Subject: [PATCH 5/8] TrebleSettings: Alternative audio jack detection
@ -13,10 +13,10 @@ Change-Id: I5d6d48f26a4a2134fd6edf996eca89a1fc42e6de
create mode 100644 src/com/android/settings/treble/UseAlternativeAudioJackDetectionPreferenceController.java
diff --git a/res/values/strings.xml b/res/values/strings.xml
index e91a4d36c8..4f8eb839f3 100644
index bfa28394c7..be942eb6d9 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -8475,6 +8475,8 @@
@@ -8515,6 +8515,8 @@
<string name="disable_soundvolume_effect_title">Disable soundvolume effect</string>
<!-- Treble settings screen, disable A2DP offload title -->
<string name="disable_a2dp_offload_title">Disable A2DP offload</string>
@ -112,5 +112,5 @@ index 0000000000..0d60b72db1
+
+}
--
2.25.1
2.34.1

View File

@ -1,4 +1,4 @@
From c37241c9ac2caa23576f9f40ebbe73d9db3467b8 Mon Sep 17 00:00:00 2001
From ed12a1c194aaf80b4c466fbca43bd846fc03137b Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sat, 17 Dec 2022 10:29:05 +0000
Subject: [PATCH 6/8] TrebleSettings: Override minimum brightness
@ -13,10 +13,10 @@ Change-Id: I6d621f7dd04b675b6e2e851a5e474dc9a9841eb0
create mode 100644 src/com/android/settings/treble/OverrideMinimumBrightnessPreferenceController.java
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 4f8eb839f3..649182030e 100644
index be942eb6d9..6db51f1f44 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -8481,6 +8481,8 @@
@@ -8521,6 +8521,8 @@
<string name="screen_resolution_refresh_rate_title">Screen resolution &amp; refresh rate</string>
<!-- Treble settings screen, use alternative backlight scale title -->
<string name="use_alternative_backlight_scale_title">Use alternative backlight scale</string>
@ -112,5 +112,5 @@ index 09aa001e82..39a0e19972 100644
controllers.add(new OverrideVolteAvailabilityPreferenceController(context));
return controllers;
--
2.25.1
2.34.1

View File

@ -1,4 +1,4 @@
From ce30fb743f306ecacc3515f382b41999591aa3df Mon Sep 17 00:00:00 2001
From a6a87bfde5a552ac56f4e0a9c5fc4d20651bcb1a Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sat, 17 Dec 2022 11:00:38 +0000
Subject: [PATCH 7/8] TrebleSettings: Override navbar availability
@ -13,10 +13,10 @@ Change-Id: I7c771caf6274543fed23a8cc47411bf8c369ac2c
create mode 100644 src/com/android/settings/treble/OverrideNavbarAvailabilityPreferenceController.java
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 649182030e..bad4ed1ca7 100644
index 6db51f1f44..6230aae707 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -8468,6 +8468,8 @@
@@ -8508,6 +8508,8 @@
<string name="treble_settings_category_name_display">Display</string>
<!-- IMS category name [CHAR LIMIT=none] -->
<string name="treble_settings_category_name_ims">IMS</string>
@ -25,7 +25,7 @@ index 649182030e..bad4ed1ca7 100644
<!-- Treble settings screen, use alternative audio policy title -->
<string name="use_alternative_audio_policy_title">Use alternative audio policy</string>
@@ -8490,6 +8492,8 @@
@@ -8530,6 +8532,8 @@
<string name="install_ims_apk_toast_completed">IMS APK installed. Reboot required.</string>
<!-- Treble settings screen, override VoLTE availability title -->
<string name="override_volte_availability_title">Override VoLTE availability</string>
@ -124,5 +124,5 @@ index 39a0e19972..634b7ce3ce 100644
}
--
2.25.1
2.34.1

View File

@ -1,4 +1,4 @@
From 9b1a3e0cc42698946fd9453fdadfe0bcf2be3c15 Mon Sep 17 00:00:00 2001
From 4d81eae95fe9b0265faee7fffafdc9487c856569 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sat, 17 Dec 2022 14:30:52 +0000
Subject: [PATCH 8/8] TrebleSettings: Securize on-demand
@ -13,10 +13,10 @@ Change-Id: I76f54620277ccdc41636d74d1afa6330c382ce6a
create mode 100644 src/com/android/settings/treble/SecurizePreferenceController.java
diff --git a/res/values/strings.xml b/res/values/strings.xml
index bad4ed1ca7..a6860abcea 100644
index 6230aae707..62062b5fe8 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -8468,6 +8468,8 @@
@@ -8508,6 +8508,8 @@
<string name="treble_settings_category_name_display">Display</string>
<!-- IMS category name [CHAR LIMIT=none] -->
<string name="treble_settings_category_name_ims">IMS</string>
@ -25,7 +25,7 @@ index bad4ed1ca7..a6860abcea 100644
<!-- UI category name [CHAR LIMIT=none] -->
<string name="treble_settings_category_name_ui">UI</string>
@@ -8492,6 +8494,10 @@
@@ -8532,6 +8534,10 @@
<string name="install_ims_apk_toast_completed">IMS APK installed. Reboot required.</string>
<!-- Treble settings screen, override VoLTE availability title -->
<string name="override_volte_availability_title">Override VoLTE availability</string>
@ -129,5 +129,5 @@ index 634b7ce3ce..149c18f231 100644
return controllers;
}
--
2.25.1
2.34.1