Sync up to v300.j

This commit is contained in:
Andy CrossGate Yan
2020-12-20 09:56:40 +00:00
parent 4048bfed3a
commit 2347b96190
7 changed files with 177 additions and 70 deletions

View File

@@ -0,0 +1,91 @@
From aaa019b5f93c3954441456259b30077bdd96d784 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Sun, 6 Dec 2020 12:20:08 +0100
Subject: [PATCH] Make rounded corners padding overridable with
persist.sys.phh.rounded_corners_padding
Change-Id: Id5d73b06b9a2cb2da95ff31f204c1984555872ff
---
.../src/com/android/systemui/qs/QuickStatusBarHeader.java | 6 +++++-
.../systemui/statusbar/phone/KeyguardStatusBarView.java | 6 +++++-
.../systemui/statusbar/phone/PhoneStatusBarView.java | 6 +++++-
3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java b/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
index 7533f2ac1db3..94fd996d0858 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
@@ -32,6 +32,7 @@ import android.graphics.Rect;
import android.media.AudioManager;
import android.os.Handler;
import android.os.Looper;
+import android.os.SystemProperties;
import android.provider.AlarmClock;
import android.provider.Settings;
import android.service.notification.ZenModeConfig;
@@ -447,8 +448,11 @@ public class QuickStatusBarHeader extends RelativeLayout implements
Resources resources = mContext.getResources();
updateMinimumHeight();
- mRoundedCornerPadding = resources.getDimensionPixelSize(
+ mRoundedCornerPadding = SystemProperties.getInt("persist.sys.phh.rounded_corners_padding", -1);
+ if (mRoundedCornerPadding == -1) {
+ mRoundedCornerPadding = resources.getDimensionPixelSize(
R.dimen.rounded_corner_content_padding);
+ }
mStatusBarPaddingTop = resources.getDimensionPixelSize(R.dimen.status_bar_padding_top);
// Update height for a few views, especially due to landscape mode restricting space.
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 8a4ea21a11ca..a54269460e50 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java
@@ -25,6 +25,7 @@ import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
+import android.os.SystemProperties;
import android.util.AttributeSet;
import android.util.Pair;
import android.util.TypedValue;
@@ -186,8 +187,11 @@ public class KeyguardStatusBarView extends RelativeLayout
R.dimen.system_icons_super_container_avatarless_margin_end);
mCutoutSideNudge = getResources().getDimensionPixelSize(
R.dimen.display_cutout_margin_consumption);
- mRoundedCornerPadding = res.getDimensionPixelSize(
+ mRoundedCornerPadding = SystemProperties.getInt("persist.sys.phh.rounded_corners_padding", -1);
+ if (mRoundedCornerPadding == -1) {
+ mRoundedCornerPadding = res.getDimensionPixelSize(
R.dimen.rounded_corner_content_padding);
+ }
}
private void updateVisibilities() {
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 7c41bcd09b57..b0cf69b65f5d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
@@ -24,6 +24,7 @@ import android.annotation.Nullable;
import android.content.Context;
import android.content.res.Configuration;
import android.graphics.Rect;
+import android.os.SystemProperties;
import android.util.AttributeSet;
import android.util.EventLog;
import android.util.Pair;
@@ -287,8 +288,11 @@ public class PhoneStatusBarView extends PanelBar {
public void updateResources() {
mCutoutSideNudge = getResources().getDimensionPixelSize(
R.dimen.display_cutout_margin_consumption);
- mRoundedCornerPadding = getResources().getDimensionPixelSize(
+ mRoundedCornerPadding = SystemProperties.getInt("persist.sys.phh.rounded_corners_padding", -1);
+ if (mRoundedCornerPadding == -1) {
+ mRoundedCornerPadding = getResources().getDimensionPixelSize(
R.dimen.rounded_corner_content_padding);
+ }
updateStatusBarHeight();
}
--
2.25.1