Changes for January 2022, syncing up to v400.h

This commit is contained in:
Andy CrossGate Yan
2022-01-13 14:32:50 +00:00
parent 463b837c1b
commit d4c58201c8
98 changed files with 2429 additions and 751 deletions

View File

@@ -0,0 +1,128 @@
From e37d16ac9d6d84412f64243dee1c48d8b1eb6ed5 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/21] Add SPenPointerOverlay
Toggle this overlay with property "persist.ui.spen.pointer"
Change-Id: I21f7e05cf8ebd74c950dfb20cf7eee99bfe22988
---
packages/overlays/Android.mk | 3 +-
.../overlays/SPenPointerOverlay/Android.bp | 28 ++++++++++++++++++
.../SPenPointerOverlay/AndroidManifest.xml | 23 ++++++++++++++
.../sem_pointer_spot_hovering_spen.png | Bin 0 -> 411 bytes
.../res/drawable/pointer_arrow_icon.xml | 5 ++++
5 files changed, 58 insertions(+), 1 deletion(-)
create mode 100644 packages/overlays/SPenPointerOverlay/Android.bp
create mode 100644 packages/overlays/SPenPointerOverlay/AndroidManifest.xml
create mode 100644 packages/overlays/SPenPointerOverlay/res/drawable-xxhdpi/sem_pointer_spot_hovering_spen.png
create mode 100644 packages/overlays/SPenPointerOverlay/res/drawable/pointer_arrow_icon.xml
diff --git a/packages/overlays/Android.mk b/packages/overlays/Android.mk
index 928892c60e47..3a114bc8ec79 100644
--- a/packages/overlays/Android.mk
+++ b/packages/overlays/Android.mk
@@ -31,7 +31,8 @@ LOCAL_REQUIRED_MODULES := \
NavigationBarModeGesturalOverlayNarrowBack \
NavigationBarModeGesturalOverlayWideBack \
NavigationBarModeGesturalOverlayExtraWideBack \
- OneHandedModeGesturalOverlay \
+ OneHandedModeGesturalOverlay \
+ SPenPointerOverlay \
preinstalled-packages-platform-overlays.xml
include $(BUILD_PHONY_PACKAGE)
diff --git a/packages/overlays/SPenPointerOverlay/Android.bp b/packages/overlays/SPenPointerOverlay/Android.bp
new file mode 100644
index 000000000000..7632ebd43ef6
--- /dev/null
+++ b/packages/overlays/SPenPointerOverlay/Android.bp
@@ -0,0 +1,28 @@
+//
+// Copyright 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 {
+ // See: http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // all of the 'license_kinds' from "frameworks_base_license"
+ // to get the below license kinds:
+ // SPDX-license-identifier-Apache-2.0
+ default_applicable_licenses: ["frameworks_base_license"],
+}
+
+runtime_resource_overlay {
+ name: "SPenPointerOverlay",
+ product_specific: true,
+}
diff --git a/packages/overlays/SPenPointerOverlay/AndroidManifest.xml b/packages/overlays/SPenPointerOverlay/AndroidManifest.xml
new file mode 100644
index 000000000000..b785214f854b
--- /dev/null
+++ b/packages/overlays/SPenPointerOverlay/AndroidManifest.xml
@@ -0,0 +1,23 @@
+<!--
+ ~ 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.
+ -->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.samsung.android.spenpointer.overlay"
+ android:versionCode="1"
+ android:versionName="1.0">
+ <overlay android:targetPackage="android" android:priority="5932" android:isStatic="true"
+ android:requiredSystemPropertyName="persist.ui.spen.pointer" android:requiredSystemPropertyValue="true"/>
+</manifest>
diff --git a/packages/overlays/SPenPointerOverlay/res/drawable-xxhdpi/sem_pointer_spot_hovering_spen.png b/packages/overlays/SPenPointerOverlay/res/drawable-xxhdpi/sem_pointer_spot_hovering_spen.png
new file mode 100644
index 0000000000000000000000000000000000000000..b73246c80a95e0bceeb8c09aacd2653722fca2d2
GIT binary patch
literal 411
zcmeAS@N?(olHy`uVBq!ia0vp^av;pX3?zBp#Z3TG?EyX^u0VPYDww}y>9XB>H{O1*
z{q+Z+%%XMcH{QCp_4%7Ek6&zi^&Z52_8N#bKYY6T$G`bYmOylGdHNEl2EyKW`#w-H
zMEkav?|=xXa@&iyKv|#(o9;XSGJv*hefA2d9ViRrHpmHroTOV4<QL2kefT?*&XynF
zf9jt6d~bTxr(K#H%-fm6)$T^@`96*P!_O$D=#P=#_iokL5u<mvYQ}e<#%Z1|jv*T7
z-(HO6Z&DCpO9*-59T;HT8)CHh%)kHdv-@V7U0D0tD*XMooHrlj82&Lg8FU>wkZ<5N
zBf!g`Yhiojq)$5MjpwPIIqY#_(VA78COitTt~#=3<I2pBClgEGRn7j@r_s({E14^`
zzN)C=(stXhXOBPbPTyLVZ~8%?D9+x@`{Nq(tjK9wr(Jhj*%s6+*nEHflkLxVMFlvw
UdB5Fp8R$X=Pgg&ebxsLQ0B%Ow$N&HU
literal 0
HcmV?d00001
diff --git a/packages/overlays/SPenPointerOverlay/res/drawable/pointer_arrow_icon.xml b/packages/overlays/SPenPointerOverlay/res/drawable/pointer_arrow_icon.xml
new file mode 100644
index 000000000000..6db08716fc62
--- /dev/null
+++ b/packages/overlays/SPenPointerOverlay/res/drawable/pointer_arrow_icon.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<pointer-icon xmlns:android="http://schemas.android.com/apk/res/android"
+ android:bitmap="@drawable/sem_pointer_spot_hovering_spen"
+ android:hotSpotX="5dp"
+ android:hotSpotY="5dp" />
--
2.25.1

View File

@@ -1,7 +1,7 @@
From 5c49797b6d93903bdfc4a6938eb18657f3525570 Mon Sep 17 00:00:00 2001
From 6379c3431defb061fbc793982c1ba88b9d475e99 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 01/22] Disable vendor mismatch warning
Subject: [PATCH 02/21] 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 08f3b1a8c6e0..d0387cc38d3d 100644
index 5d0d182230e1..789968e19ab6 100644
--- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
+++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
@@ -5499,20 +5499,8 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
@@ -5508,20 +5508,8 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
}
if (!Build.isBuildConsistent()) {

View File

@@ -1,7 +1,7 @@
From f4af00e6769797999721cbfe4673a7f2f0c76278 Mon Sep 17 00:00:00 2001
From f7b8284284e3eb360a2403fc6782ccfff96bb99b 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 02/22] UI: Adjust default navbar layouts
Subject: [PATCH 03/21] 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 d274c917c26d..14276754e450 100644
index d0098b32f384..62e4e27dca2a 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -350,7 +350,7 @@

View File

@@ -1,7 +1,7 @@
From 07a09e5d704b6971a5c061ac65bb7d765e368dec Mon Sep 17 00:00:00 2001
From b6ee471eb9405c82d26fc2cddc4c1446fa872467 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Fri, 9 Mar 2018 15:41:26 +0800
Subject: [PATCH 03/22] UI: Disable left (seascape) navigation bar optionally
Subject: [PATCH 04/21] UI: Disable left (seascape) navigation bar optionally
Toggle this behaviour with property "persist.ui.seascape.disable"
@@ -45,10 +45,10 @@ index f1e1366404a2..f43bef8532b8 100644
for (int i = 0; i < group.getChildCount(); i++) {
final View child = group.getChildAt(i);
diff --git a/services/core/java/com/android/server/wm/DisplayPolicy.java b/services/core/java/com/android/server/wm/DisplayPolicy.java
index d0457b08aa34..d165552d5ce8 100644
index 21bca6ed6a53..b699c4e4f38d 100644
--- a/services/core/java/com/android/server/wm/DisplayPolicy.java
+++ b/services/core/java/com/android/server/wm/DisplayPolicy.java
@@ -2352,9 +2352,10 @@ public class DisplayPolicy {
@@ -2388,9 +2388,10 @@ public class DisplayPolicy {
@NavigationBarPosition
int navigationBarPosition(int displayWidth, int displayHeight, int displayRotation) {
if (navigationBarCanMove() && displayWidth > displayHeight) {

View File

@@ -1,7 +1,7 @@
From 58f4875f7b157bf408bd770a4131d5ee0c98f7da Mon Sep 17 00:00:00 2001
From a8f18ce03f513f63f98c14b89918011e8e30ca93 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 04/22] UI: Disable wallpaper zoom
Subject: [PATCH 05/21] 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 b7dfd49b7b78..08940c03b095 100644
index 3ce1886fef6d..d8f280ddbf93 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -4768,7 +4768,7 @@
@@ -4770,7 +4770,7 @@
<string name="config_customMediaSessionPolicyProvider"></string>
<!-- The max scale for the wallpaper when it's zoomed in -->

View File

@@ -1,7 +1,7 @@
From 88c071a7385821219dbb90bc8475bece813e84c9 Mon Sep 17 00:00:00 2001
From b2a7f77623b07fbea767605ba8ad5bbe6ed94c70 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 05/22] UI: Increase default status bar height
Subject: [PATCH 06/21] UI: Increase default status bar height
Change-Id: Ibbcf63159e19bb2bb2b1094ea07ab85917630b07
---

View File

@@ -1,83 +0,0 @@
From af017461178d08dcd0999b76d800e1e4f773c09b 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 06/22] UI: Revive navbar layout tuning via sysui_nav_bar
tunable
Google keeps fixing what ain't broken.
Change-Id: Ied7d7859e50fd0fcc346219964e747c5d5f4c352
---
.../NavigationBarInflaterView.java | 30 ++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)
diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarInflaterView.java b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarInflaterView.java
index 4d9175b8db68..293ebb374241 100644
--- a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarInflaterView.java
+++ b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarInflaterView.java
@@ -43,12 +43,13 @@ import com.android.systemui.navigationbar.buttons.ReverseLinearLayout;
import com.android.systemui.navigationbar.buttons.ReverseLinearLayout.ReverseRelativeLayout;
import com.android.systemui.recents.OverviewProxyService;
import com.android.systemui.shared.system.QuickStepContract;
+import com.android.systemui.tuner.TunerService;
import java.io.PrintWriter;
import java.util.Objects;
public class NavigationBarInflaterView extends FrameLayout
- implements NavigationModeController.ModeChangedListener {
+ implements NavigationModeController.ModeChangedListener, TunerService.Tunable {
private static final String TAG = "NavBarInflater";
@@ -102,6 +103,8 @@ public class NavigationBarInflaterView extends FrameLayout
private OverviewProxyService mOverviewProxyService;
private int mNavBarMode = NAV_BAR_MODE_3BUTTON;
+ private boolean mUsingCustomLayout;
+
public NavigationBarInflaterView(Context context, AttributeSet attrs) {
super(context, attrs);
createInflaters();
@@ -151,13 +154,38 @@ public class NavigationBarInflaterView extends FrameLayout
mNavBarMode = mode;
}
+ @Override
+ protected void onAttachedToWindow() {
+ super.onAttachedToWindow();
+ Dependency.get(TunerService.class).addTunable(this, NAV_BAR_VIEWS);
+ }
+
@Override
protected void onDetachedFromWindow() {
Dependency.get(NavigationModeController.class).removeListener(this);
+ Dependency.get(TunerService.class).removeTunable(this);
super.onDetachedFromWindow();
}
+ @Override
+ public void onTuningChanged(String key, String newValue) {
+ if (NAV_BAR_VIEWS.equals(key)) {
+ setNavigationBarLayout(newValue);
+ }
+ }
+
+ public void setNavigationBarLayout(String layoutValue) {
+ if (!Objects.equals(mCurrentLayout, layoutValue)) {
+ mUsingCustomLayout = layoutValue != null;
+ clearViews();
+ inflateLayout(layoutValue);
+ }
+ }
+
public void onLikelyDefaultLayoutChange() {
+ // Don't override custom layouts
+ if (mUsingCustomLayout) return;
+
// Reevaluate new layout
final String newValue = getDefaultLayout();
if (!Objects.equals(mCurrentLayout, newValue)) {
--
2.25.1

View File

@@ -0,0 +1,64 @@
From a77071568a33266c3f93db359d865eddd2b38313 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 07/21] UI: Revive navbar layout tuning via sysui_nav_bar
tunable
Google keeps fixing what ain't broken.
Change-Id: Ied7d7859e50fd0fcc346219964e747c5d5f4c352
---
.../navigationbar/NavigationBarInflaterView.java | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarInflaterView.java b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarInflaterView.java
index c8bc143f0bd8..fab079b91608 100644
--- a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarInflaterView.java
+++ b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarInflaterView.java
@@ -118,6 +118,7 @@ public class NavigationBarInflaterView extends FrameLayout
private boolean mInverseLayout;
private boolean mIsHintEnabled;
+ private boolean mUsingCustomLayout;
public NavigationBarInflaterView(Context context, AttributeSet attrs) {
super(context, attrs);
@@ -177,6 +178,7 @@ public class NavigationBarInflaterView extends FrameLayout
super.onAttachedToWindow();
Dependency.get(TunerService.class).addTunable(this, NAV_BAR_INVERSE);
Dependency.get(TunerService.class).addTunable(this, KEY_NAVIGATION_HINT);
+ Dependency.get(TunerService.class).addTunable(this, NAV_BAR_VIEWS);
}
@Override
@@ -195,6 +197,8 @@ public class NavigationBarInflaterView extends FrameLayout
mIsHintEnabled = TunerService.parseIntegerSwitch(newValue, true);
updateHint();
onLikelyDefaultLayoutChange();
+ } else if (NAV_BAR_VIEWS.equals(key)) {
+ setNavigationBarLayout(newValue);
}
}
@@ -204,7 +208,18 @@ public class NavigationBarInflaterView extends FrameLayout
updateLayoutInversion();
}
+ public void setNavigationBarLayout(String layoutValue) {
+ if (!Objects.equals(mCurrentLayout, layoutValue)) {
+ mUsingCustomLayout = layoutValue != null;
+ clearViews();
+ inflateLayout(layoutValue);
+ }
+ }
+
public void onLikelyDefaultLayoutChange() {
+ // Don't override custom layouts
+ if (mUsingCustomLayout) return;
+
// Reevaluate new layout
final String newValue = getDefaultLayout();
if (!Objects.equals(mCurrentLayout, newValue)) {
--
2.25.1

View File

@@ -1,7 +1,7 @@
From 3da8e7d5f61c024dd70a311f9b67622f419c07a0 Mon Sep 17 00:00:00 2001
From 064121d33cea08c574f5bd80b10bd3b3721241cc 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 07/22] UI: Use SNAP_FIXED_RATIO for multi-window globally
Subject: [PATCH 08/21] 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 08940c03b095..1319c26bb1be 100644
index d8f280ddbf93..3a62b51d3cbc 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -3529,7 +3529,7 @@
@@ -3531,7 +3531,7 @@
1 - 3 snap targets: fixed ratio, 1:1, (1 - fixed ratio)
2 - 1 snap target: 1:1
-->

View File

@@ -1,7 +1,7 @@
From 186e9e99567c3961a63535ae2b04aa172cfc1734 Mon Sep 17 00:00:00 2001
From 2e11990cb2b10f0fe3c87273d76b3875da3b2e8f Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Thu, 14 Oct 2021 15:45:24 +0000
Subject: [PATCH 08/22] UI: Unblock alarm status bar icon
Subject: [PATCH 09/21] UI: Unblock alarm status bar icon
That's very Zen of you, Google...
@@ -12,10 +12,10 @@ Change-Id: I2c9f91f47bb1e324a20c13d588dcdbbca91dc12e
2 files changed, 2 deletions(-)
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragment.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragment.java
index 6a171ceff1ed..2c1321f1c013 100644
index 2e40af4fab2a..f8c79ceabf2e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragment.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragment.java
@@ -158,7 +158,6 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
@@ -162,7 +162,6 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
}
mDarkIconManager = new DarkIconManager(view.findViewById(R.id.statusIcons), mFeatureFlags);
mDarkIconManager.setShouldLog(true);
@@ -24,10 +24,10 @@ index 6a171ceff1ed..2c1321f1c013 100644
mDarkIconManager.setBlockList(mBlockedIcons);
mStatusBarIconController.addIconGroup(mDarkIconManager);
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 f9c6ebbd26e3..7b4dc47a7b48 100644
index a32e7c4765ef..efc02548763a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java
@@ -206,7 +206,6 @@ public class KeyguardStatusBarView extends RelativeLayout implements
@@ -203,7 +203,6 @@ public class KeyguardStatusBarView extends RelativeLayout implements
// Set hidden status bar items
private void loadBlockList() {
Resources r = getResources();

View File

@@ -1,60 +0,0 @@
From 1ec1cdc8f12227b0612d258ee110432ed954dde1 Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Tue, 3 Nov 2020 22:38:49 -0800
Subject: [PATCH 09/22] core: Remove default aspect ratio limit for old apps
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
I have never encountered a single app that this aspect ratio limit is
actually helpful for. Most legacy apps are able to cope with longer
aspect ratios fine — perhaps not optimally, but it looks better than
having a big black box at the bottom of the screen.
Instead of limiting older apps' screen space unconditionally or exposing
it in Settings, remove the limit entirely so the user doesn't have to go
through the trouble to begin with. Note that apps explicitly declaring a
shorter aspect ratio will still get their constraint satisfied.
Change-Id: Ic415288b24129a634476b5cc01a6f202588f4b89
---
core/java/android/content/pm/PackageParser.java | 6 ++----
.../android/content/pm/parsing/ParsingPackageUtils.java | 5 ++---
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index 9379a634afa8..6bf772b008a7 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -4672,10 +4672,8 @@ public class PackageParser {
* ratio set.
*/
private void setMaxAspectRatio(Package owner) {
- // Default to (1.86) 16.7:9 aspect ratio for pre-O apps and unset for O and greater.
- // NOTE: 16.7:9 was the max aspect ratio Android devices can support pre-O per the CDD.
- float maxAspectRatio = owner.applicationInfo.targetSdkVersion < O
- ? DEFAULT_PRE_O_MAX_ASPECT_RATIO : 0;
+ // Start at an unlimited aspect ratio unless we get a more restrictive one
+ float maxAspectRatio = 0;
if (owner.applicationInfo.maxAspectRatio != 0) {
// Use the application max aspect ration as default if set.
diff --git a/core/java/android/content/pm/parsing/ParsingPackageUtils.java b/core/java/android/content/pm/parsing/ParsingPackageUtils.java
index dce242c9d87c..5ea07db54eb7 100644
--- a/core/java/android/content/pm/parsing/ParsingPackageUtils.java
+++ b/core/java/android/content/pm/parsing/ParsingPackageUtils.java
@@ -2584,9 +2584,8 @@ public class ParsingPackageUtils {
* ratio set.
*/
private static void setMaxAspectRatio(ParsingPackage pkg) {
- // Default to (1.86) 16.7:9 aspect ratio for pre-O apps and unset for O and greater.
- // NOTE: 16.7:9 was the max aspect ratio Android devices can support pre-O per the CDD.
- float maxAspectRatio = pkg.getTargetSdkVersion() < O ? DEFAULT_PRE_O_MAX_ASPECT_RATIO : 0;
+ // Start at an unlimited aspect ratio unless we get a more restrictive one
+ float maxAspectRatio = 0;
float packageMaxAspectRatio = pkg.getMaxAspectRatio();
if (packageMaxAspectRatio != 0) {
--
2.25.1

View File

@@ -0,0 +1,31 @@
From 4247002faaf6768550040aec3132ca2015c6543c Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Tue, 3 Nov 2020 22:43:12 -0800
Subject: [PATCH 10/21] 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
newer version if one existed. Sometimes, using an old app is necessary
for one reason or another, so remove this annoyance and let the user use
their old app in peace.
Change-Id: I1a3021f0f9bec1ab6ff7641776391e1bd4c3cc49
---
services/core/java/com/android/server/wm/AppWarnings.java | 1 -
1 file changed, 1 deletion(-)
diff --git a/services/core/java/com/android/server/wm/AppWarnings.java b/services/core/java/com/android/server/wm/AppWarnings.java
index 994f07959f3b..6749ae78c09c 100644
--- a/services/core/java/com/android/server/wm/AppWarnings.java
+++ b/services/core/java/com/android/server/wm/AppWarnings.java
@@ -168,7 +168,6 @@ class AppWarnings {
public void onStartActivity(ActivityRecord r) {
showUnsupportedCompileSdkDialogIfNeeded(r);
showUnsupportedDisplaySizeDialogIfNeeded(r);
- showDeprecatedTargetDialogIfNeeded(r);
}
/**
--
2.25.1

View File

@@ -1,7 +1,7 @@
From c1d673a010c19018d37ec21c2bbed09480c4dce9 Mon Sep 17 00:00:00 2001
From 5403541355fe9d511591a10850d4e141f038a30b Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Tue, 5 Oct 2021 21:01:15 -0700
Subject: [PATCH 10/22] SystemUI: Always refresh power menu on UI mode change
Subject: [PATCH 11/21] SystemUI: Always refresh power menu on UI mode change
This is necessary for reliably theming the global actions dialog with
dynamic colors and adapting it to light/dark themes.
@@ -15,10 +15,10 @@ Change-Id: Id6f6623096ed231e841ca3794b47f8a0ab54dae6
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java
index 9ada54b9ef6f..1ae3b31fd836 100644
index 65c520ef2ff4..43a1084540f6 100644
--- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java
+++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java
@@ -703,7 +703,7 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene
@@ -762,7 +762,7 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene
@Override
public void onUiModeChanged() {
mContext.getTheme().applyStyle(mContext.getThemeResId(), true);

View File

@@ -1,7 +1,7 @@
From 314462d52502de4c850b3e657bdca280679188e1 Mon Sep 17 00:00:00 2001
From 19c047cf3be7c3bcd1254c0b62fa3e9d5d0ae733 Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Sat, 9 Oct 2021 14:39:38 -0700
Subject: [PATCH 11/22] SystemUI: Use Monet colors for power menu
Subject: [PATCH 12/21] SystemUI: Use Monet colors for power menu
It's odd that the power menu doesn't use Monet colors, unlike most of
System UI. This makes it feel more integrated with the rest of the

View File

@@ -1,7 +1,7 @@
From d6a215d67f767fe6a793dd66f5bf8dcd02f48d57 Mon Sep 17 00:00:00 2001
From a3d2feb6e711e9a96cec4fa19276be18bdda118c Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Wed, 6 Oct 2021 18:40:30 -0700
Subject: [PATCH 12/22] Revert "Make QS always use dark theme colors"
Subject: [PATCH 13/21] Revert "Make QS always use dark theme colors"
This reverts commit d62f7249f9e3222da95ecf6816601c408aac6be5.

View File

@@ -1,7 +1,7 @@
From 1ed0fb3e67d9d1f41435e7e60b801837a83c2c64 Mon Sep 17 00:00:00 2001
From aadd3892d31154fd43307f3ac1293b9a1ed011b6 Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Wed, 6 Oct 2021 18:41:11 -0700
Subject: [PATCH 13/22] Revert "Do not re-inflate QS and SB when
Subject: [PATCH 14/21] Revert "Do not re-inflate QS and SB when
CONFIG_UI_MODE"
This reverts commit 8a40ff855b86bc86e23367017002289920855a4e.

View File

@@ -1,7 +1,7 @@
From c0aadaca1ab833a13ecacc48cf5c458427f8f6b4 Mon Sep 17 00:00:00 2001
From a9bd8968c9baae389fd4e5cc54d2c4403d603690 Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Mon, 11 Oct 2021 19:24:58 -0700
Subject: [PATCH 14/22] SystemUI: Follow light/dark theme in quick settings
Subject: [PATCH 15/21] SystemUI: Follow light/dark theme in quick settings
Android 12's dual-tone style where the quick settings panel is always
dark makes the light theme look like a second-class citizen. Pure black
@@ -25,15 +25,15 @@ https://twitter.com/kdrag0n/status/1445922541218922496
Change-Id: I3d45b72f0f119e100505409d178ab8f698993881
---
.../brightness_progress_full_drawable.xml | 2 +-
.../qs_footer_action_chip_background.xml | 8 +-------
.../qs_security_footer_background.xml | 3 +--
packages/SystemUI/res/values-night/styles.xml | 12 +++++++++++
packages/SystemUI/res/values/styles.xml | 10 +++++-----
.../systemui/privacy/OngoingPrivacyChip.kt | 4 ++--
.../qs_footer_action_chip_background.xml | 8 +----
.../qs_security_footer_background.xml | 3 +-
packages/SystemUI/res/values-night/styles.xml | 12 ++++++++
packages/SystemUI/res/values/styles.xml | 10 +++----
.../systemui/privacy/OngoingPrivacyChip.kt | 4 +--
.../systemui/qs/tileimpl/QSTileViewImpl.kt | 2 +-
.../statusbar/phone/ScrimController.java | 2 +-
.../systemui/statusbar/phone/ScrimState.java | 20 +++++++++----------
9 files changed, 34 insertions(+), 29 deletions(-)
.../systemui/statusbar/phone/ScrimState.java | 30 +++++++++----------
9 files changed, 39 insertions(+), 34 deletions(-)
diff --git a/packages/SystemUI/res/drawable/brightness_progress_full_drawable.xml b/packages/SystemUI/res/drawable/brightness_progress_full_drawable.xml
index 4d9188c40822..1eae667c6e79 100644
@@ -176,7 +176,7 @@ index 27c129ad34c5..6bdf82a60e40 100644
mBehindAlpha = behindAlpha;
if (mState == ScrimState.SHADE_LOCKED) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimState.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimState.java
index 15b8c67fd4ba..577e33c3c8d6 100644
index 15b8c67fd4ba..e81642f7d491 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimState.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimState.java
@@ -88,7 +88,7 @@ public enum ScrimState {
@@ -250,6 +250,39 @@ index 15b8c67fd4ba..577e33c3c8d6 100644
}
}
},
@@ -290,27 +290,27 @@ public enum ScrimState {
mAnimateChange = !mLaunchingAffordanceWithPreview;
mFrontTint = Color.TRANSPARENT;
- mBehindTint = Color.BLACK;
- mBubbleTint = Color.BLACK;
+ mBehindTint = Color.TRANSPARENT;
+ mBubbleTint = Color.TRANSPARENT;
mBlankScreen = false;
if (previousState == ScrimState.AOD) {
// Set all scrims black, before they fade transparent.
updateScrimColor(mScrimInFront, 1f /* alpha */, Color.BLACK /* tint */);
- updateScrimColor(mScrimBehind, 1f /* alpha */, Color.BLACK /* tint */);
+ updateScrimColor(mScrimBehind, 1f /* alpha */, Color.TRANSPARENT /* tint */);
if (mScrimForBubble != null) {
updateScrimColor(mScrimForBubble, 1f /* alpha */, Color.BLACK /* tint */);
}
// Scrims should still be black at the end of the transition.
mFrontTint = Color.BLACK;
- mBehindTint = Color.BLACK;
+ mBehindTint = Color.TRANSPARENT;
mBubbleTint = Color.BLACK;
mBlankScreen = true;
}
if (mClipQsScrim) {
- updateScrimColor(mScrimBehind, 1f /* alpha */, Color.BLACK);
+ updateScrimColor(mScrimBehind, 1f /* alpha */, Color.TRANSPARENT);
}
mAnimationDuration = ScrimController.ANIMATION_DURATION;
@@ -468,4 +468,4 @@ public enum ScrimState {
public void setClipQsScrim(boolean clipsQsScrim) {
mClipQsScrim = clipsQsScrim;

View File

@@ -1,7 +1,7 @@
From a49d127bf72839cdbeb1bea6e1b7e21612ae91a9 Mon Sep 17 00:00:00 2001
From 18493a29e0c14b70e112e2e4f9ced0eca413bad7 Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Mon, 11 Oct 2021 19:25:02 -0700
Subject: [PATCH 15/22] SystemUI: Initialize QS tiles in inactive state
Subject: [PATCH 16/21] SystemUI: Initialize QS tiles in inactive state
Now that the QS fragment is recreated when changing the UI mode (so that
it follows light/dark themes), all tiles flash with active color briefly

View File

@@ -1,7 +1,7 @@
From 798b251cd278e00d214e99f4d35bdd81140e973b Mon Sep 17 00:00:00 2001
From 2d092c73ebc947960e09ba5a1a1a884224206c4b Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Mon, 11 Oct 2021 19:25:08 -0700
Subject: [PATCH 16/22] SystemUI: Add dual-tone light and dark themes for QS
Subject: [PATCH 17/21] SystemUI: Add dual-tone light and dark themes for QS
Google's dual-tone QS design where the notification panel has a
semantically higher elevation adds depth to the notification+QS shade,

View File

@@ -1,7 +1,7 @@
From 02806d68e92827a0799395338d3b29c055e176ef Mon Sep 17 00:00:00 2001
From e9e767ef589530c378b9233ae3d3c5aa37f500ec Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Mon, 11 Oct 2021 19:25:11 -0700
Subject: [PATCH 17/22] SystemUI: Remove nav bar background in QS customizer
Subject: [PATCH 18/21] SystemUI: Remove nav bar background in QS customizer
This looks outdated, since most apps are edge-to-edge nowadays.

View File

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

View File

@@ -1,31 +0,0 @@
From 7850ab773ef48f6fddb166e1af10fce56ba06648 Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Sat, 16 Oct 2021 03:27:23 -0700
Subject: [PATCH 20/22] SystemUI: Expose legacy Wi-Fi and cellular data QS
tiles
We'll still use Android 12's unified internet settings and the Internet
tile by default, but expose the legacy Wi-Fi and cellular data tiles so
that users can add them with the QS customizer.
Change-Id: I65902b38c99f61782bd9aa0ea604848fbd068bda
---
packages/SystemUI/res/values/config.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index 14276754e450..c99ab8bf5e9a 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -107,7 +107,7 @@
<!-- Tiles native to System UI. Order should match "quick_settings_tiles_default" -->
<string name="quick_settings_tiles_stock" translatable="false">
- internet,bt,flashlight,dnd,alarm,airplane,controls,wallet,rotation,battery,cast,screenrecord,mictoggle,cameratoggle,location,hotspot,inversion,saver,dark,work,night,reverse,reduce_brightness
+ internet,wifi,cell,bt,flashlight,dnd,alarm,airplane,controls,wallet,rotation,battery,cast,screenrecord,mictoggle,cameratoggle,location,hotspot,inversion,saver,dark,work,night,reverse,reduce_brightness
</string>
<!-- The tiles to display in QuickSettings -->
--
2.25.1

View File

@@ -1,7 +1,7 @@
From 00373ab57fc28c8f1e5320748879d99b30d49112 Mon Sep 17 00:00:00 2001
From 4cafce4750d1834d48d806623d84f9625c0ba3a9 Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Tue, 5 Oct 2021 21:02:12 -0700
Subject: [PATCH 19/22] SystemUI: Fix QS status font weight mismatch in dark
Subject: [PATCH 20/21] SystemUI: Fix QS status font weight mismatch in dark
mode
Text in the QS status bar is medium in light mode and regular in dark

View File

@@ -1,13 +1,15 @@
From 00463f495ad23afddbf5bc0b4c227e63d09bc8e4 Mon Sep 17 00:00:00 2001
From d219b7a9aefd4a744e66ea331dc5ac127c9b3ab3 Mon Sep 17 00:00:00 2001
From: SagarMakhar <sagarmakhar@gmail.com>
Date: Sat, 6 Nov 2021 13:16:24 +0000
Subject: [PATCH 22/22] Fix QS clock being white on light theme
Subject: [PATCH 21/21] Fix QS clock being white on light theme
Steps to reproduce without this commit:
- Turn off dark theme
- Play a song and wait for media player to show in QS
- Confirm clock text color is white
Signed-off-by: SagarMakhar <sagarmakhar@gmail.com>
Change-Id: I62aeba57e1ce458c73752faa1c9d80d26a63f625
Signed-off-by: SagarMakhar <sagarmakhar@gmail.com>
---
.../systemui/qs/QuickStatusBarHeaderController.java | 13 -------------

View File

@@ -1,245 +0,0 @@
From 6ec18b7fe383ba54de08df6d6d76b74361491ddd Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Mon, 25 Oct 2021 19:32:33 -0700
Subject: [PATCH 21/22] SystemUI: Allow Wi-Fi/cell tiles to co-exist with
provider model
The dedicated Wi-Fi/cellular data QS tiles are partially working now
that we've exposed them in the list of tile options, but they're very
buggy and somewhat broken when the provider model (unified internet) is
enabled.
Allow the tiles to co-exist with InternetTile and the provider model
(including both settings_provider_model and combined signal icons) by
always including QS icons in Wi-Fi/data indicator callbacks, and add
a new flag to indicate whether they should be shown in the internet
tile.
Change-Id: I10af134b35dfabdb9275f1aca8ca8512e1db6d27
---
.../systemui/qs/tiles/InternetTile.java | 4 +-
.../policy/MobileSignalController.java | 32 ++++--------
.../statusbar/policy/NetworkController.java | 10 +++-
.../policy/WifiSignalController.java | 49 +++++++------------
4 files changed, 37 insertions(+), 58 deletions(-)
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/InternetTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/InternetTile.java
index cc9e7485dcff..4bf8053017f1 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/InternetTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/InternetTile.java
@@ -255,7 +255,7 @@ public class InternetTile extends QSTileImpl<SignalState> {
Log.d(TAG, "setWifiIndicators: " + indicators);
}
mWifiInfo.mEnabled = indicators.enabled;
- if (indicators.qsIcon == null) {
+ if (indicators.qsIcon == null || !indicators.isDefault) {
return;
}
mWifiInfo.mConnected = indicators.qsIcon.visible;
@@ -275,7 +275,7 @@ public class InternetTile extends QSTileImpl<SignalState> {
if (DEBUG) {
Log.d(TAG, "setMobileDataIndicators: " + indicators);
}
- if (indicators.qsIcon == null) {
+ if (indicators.qsIcon == null || !indicators.isDefault) {
// Not data sim, don't display.
return;
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java
index 43781f3941ba..cf89cabf6ab9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java
@@ -397,7 +397,7 @@ public class MobileSignalController extends SignalController<MobileState, Mobile
IconState qsIcon = null;
CharSequence description = null;
// Only send data sim callbacks to QS.
- if (mCurrentState.dataSim && mCurrentState.isDefault) {
+ if (mCurrentState.dataSim) {
qsTypeIcon =
(showDataIcon || mConfig.alwaysShowDataRatIcon) ? icons.qsDataType : 0;
qsIcon = new IconState(mCurrentState.enabled
@@ -420,7 +420,7 @@ public class MobileSignalController extends SignalController<MobileState, Mobile
statusIcon, qsIcon, typeIcon, qsTypeIcon,
activityIn, activityOut, dataContentDescription, dataContentDescriptionHtml,
description, icons.isWide, mSubscriptionInfo.getSubscriptionId(),
- mCurrentState.roaming, showTriangle);
+ mCurrentState.roaming, showTriangle, mCurrentState.isDefault);
callback.setMobileDataIndicators(mobileDataIndicators);
} else {
boolean showDataIcon = mCurrentState.dataConnected || dataDisabled;
@@ -431,25 +431,13 @@ public class MobileSignalController extends SignalController<MobileState, Mobile
int qsTypeIcon = 0;
IconState qsIcon = null;
CharSequence description = null;
- // Only send data sim callbacks to QS.
- if (mProviderModelSetting) {
- if (mCurrentState.dataSim && mCurrentState.isDefault) {
- qsTypeIcon =
- (showDataIcon || mConfig.alwaysShowDataRatIcon) ? icons.qsDataType : 0;
- qsIcon = new IconState(
- mCurrentState.enabled && !mCurrentState.isEmergency,
- getQsCurrentIconId(), contentDescription);
- description = mCurrentState.isEmergency ? null : mCurrentState.networkName;
- }
- } else {
- if (mCurrentState.dataSim) {
- qsTypeIcon =
- (showDataIcon || mConfig.alwaysShowDataRatIcon) ? icons.qsDataType : 0;
- qsIcon = new IconState(
- mCurrentState.enabled && !mCurrentState.isEmergency,
- getQsCurrentIconId(), contentDescription);
- description = mCurrentState.isEmergency ? null : mCurrentState.networkName;
- }
+ if (mCurrentState.dataSim) {
+ qsTypeIcon =
+ (showDataIcon || mConfig.alwaysShowDataRatIcon) ? icons.qsDataType : 0;
+ qsIcon = new IconState(
+ mCurrentState.enabled && !mCurrentState.isEmergency,
+ getQsCurrentIconId(), contentDescription);
+ description = mCurrentState.isEmergency ? null : mCurrentState.networkName;
}
boolean activityIn = mCurrentState.dataConnected
@@ -465,7 +453,7 @@ public class MobileSignalController extends SignalController<MobileState, Mobile
statusIcon, qsIcon, typeIcon, qsTypeIcon,
activityIn, activityOut, dataContentDescription, dataContentDescriptionHtml,
description, icons.isWide, mSubscriptionInfo.getSubscriptionId(),
- mCurrentState.roaming, showTriangle);
+ mCurrentState.roaming, showTriangle, mCurrentState.isDefault);
callback.setMobileDataIndicators(mobileDataIndicators);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
index eeea699a0b74..4a25d1bd7661 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
@@ -59,10 +59,11 @@ public interface NetworkController extends CallbackController<SignalCallback>, D
public String description;
public boolean isTransient;
public String statusLabel;
+ public boolean isDefault;
public WifiIndicators(boolean enabled, IconState statusIcon, IconState qsIcon,
boolean activityIn, boolean activityOut, String description,
- boolean isTransient, String statusLabel) {
+ boolean isTransient, String statusLabel, boolean isDefault) {
this.enabled = enabled;
this.statusIcon = statusIcon;
this.qsIcon = qsIcon;
@@ -71,6 +72,7 @@ public interface NetworkController extends CallbackController<SignalCallback>, D
this.description = description;
this.isTransient = isTransient;
this.statusLabel = statusLabel;
+ this.isDefault = isDefault;
}
@Override
@@ -84,6 +86,7 @@ public interface NetworkController extends CallbackController<SignalCallback>, D
.append(",description=").append(description)
.append(",isTransient=").append(isTransient)
.append(",statusLabel=").append(statusLabel)
+ .append(",isDefault=").append(isDefault)
.append(']').toString();
}
}
@@ -105,12 +108,13 @@ public interface NetworkController extends CallbackController<SignalCallback>, D
public int subId;
public boolean roaming;
public boolean showTriangle;
+ public boolean isDefault;
public MobileDataIndicators(IconState statusIcon, IconState qsIcon, int statusType,
int qsType, boolean activityIn, boolean activityOut,
CharSequence typeContentDescription, CharSequence typeContentDescriptionHtml,
CharSequence description, boolean isWide, int subId, boolean roaming,
- boolean showTriangle) {
+ boolean showTriangle, boolean isDefault) {
this.statusIcon = statusIcon;
this.qsIcon = qsIcon;
this.statusType = statusType;
@@ -124,6 +128,7 @@ public interface NetworkController extends CallbackController<SignalCallback>, D
this.subId = subId;
this.roaming = roaming;
this.showTriangle = showTriangle;
+ this.isDefault = isDefault;
}
@Override
@@ -142,6 +147,7 @@ public interface NetworkController extends CallbackController<SignalCallback>, D
.append(",subId=").append(subId)
.append(",roaming=").append(roaming)
.append(",showTriangle=").append(showTriangle)
+ .append(",isDefault=").append(isDefault)
.append(']').toString();
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/WifiSignalController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/WifiSignalController.java
index f8e36476c4a6..1513544eb22b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/WifiSignalController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/WifiSignalController.java
@@ -112,37 +112,21 @@ public class WifiSignalController extends
if (mCurrentState.inetCondition == 0) {
contentDescription += ("," + mContext.getString(R.string.data_connection_no_internet));
}
- if (mProviderModelSetting) {
- IconState statusIcon = new IconState(
- wifiVisible, getCurrentIconId(), contentDescription);
- IconState qsIcon = null;
- if (mCurrentState.isDefault || (!mNetworkController.isRadioOn()
- && !mNetworkController.isEthernetDefault())) {
- qsIcon = new IconState(mCurrentState.connected,
- mWifiTracker.isCaptivePortal ? R.drawable.ic_qs_wifi_disconnected
- : getQsCurrentIconId(), contentDescription);
- }
- WifiIndicators wifiIndicators = new WifiIndicators(
- mCurrentState.enabled, statusIcon, qsIcon,
- ssidPresent && mCurrentState.activityIn,
- ssidPresent && mCurrentState.activityOut,
- wifiDesc, mCurrentState.isTransient, mCurrentState.statusLabel
- );
- callback.setWifiIndicators(wifiIndicators);
- } else {
- IconState statusIcon = new IconState(
- wifiVisible, getCurrentIconId(), contentDescription);
- IconState qsIcon = new IconState(mCurrentState.connected,
- mWifiTracker.isCaptivePortal ? R.drawable.ic_qs_wifi_disconnected
- : getQsCurrentIconId(), contentDescription);
- WifiIndicators wifiIndicators = new WifiIndicators(
- mCurrentState.enabled, statusIcon, qsIcon,
- ssidPresent && mCurrentState.activityIn,
- ssidPresent && mCurrentState.activityOut,
- wifiDesc, mCurrentState.isTransient, mCurrentState.statusLabel
- );
- callback.setWifiIndicators(wifiIndicators);
- }
+ IconState statusIcon = new IconState(
+ wifiVisible, getCurrentIconId(), contentDescription);
+ IconState qsIcon = new IconState(mCurrentState.connected,
+ mWifiTracker.isCaptivePortal ? R.drawable.ic_qs_wifi_disconnected
+ : getQsCurrentIconId(), contentDescription);
+ boolean isDefault = mCurrentState.isDefault ||
+ (!mNetworkController.isRadioOn() && !mNetworkController.isEthernetDefault());
+ WifiIndicators wifiIndicators = new WifiIndicators(
+ mCurrentState.enabled, statusIcon, qsIcon,
+ ssidPresent && mCurrentState.activityIn,
+ ssidPresent && mCurrentState.activityOut,
+ wifiDesc, mCurrentState.isTransient, mCurrentState.statusLabel,
+ isDefault
+ );
+ callback.setWifiIndicators(wifiIndicators);
}
private void notifyListenersForCarrierWifi(SignalCallback callback) {
@@ -173,7 +157,8 @@ public class WifiSignalController extends
statusIcon, qsIcon, typeIcon, qsTypeIcon,
mCurrentState.activityIn, mCurrentState.activityOut, dataContentDescription,
dataContentDescriptionHtml, description, icons.isWide,
- mCurrentState.subId, /* roaming= */ false, /* showTriangle= */ true
+ mCurrentState.subId, /* roaming= */ false, /* showTriangle= */ true,
+ /* isDefault= */ qsIcon != null
);
callback.setMobileDataIndicators(mobileDataIndicators);
}
--
2.25.1