From f9616e0e5ade9347155bf1ae23da948ad621db3b Mon Sep 17 00:00:00 2001 From: Tiger Date: Tue, 21 Feb 2023 23:15:45 +0800 Subject: [PATCH 1/5] Add an developer option to enable config_navBarDefaultTransparent This enables the user to make navigation bar color transparent by default. It will only affect apps which don't specify the navigation bar color. Fix: 232195501 Test: atest TransparentNavigationBarPreferenceControllerTest Change-Id: I91581558b92abeaa3501b9749f1a1ab43db8e771 --- res/xml/development_settings.xml | 5 + .../DevelopmentSettingsDashboardFragment.java | 1 + ...rentNavigationBarPreferenceController.java | 91 ++++++++++++++++ ...NavigationBarPreferenceControllerTest.java | 102 ++++++++++++++++++ 4 files changed, 199 insertions(+) create mode 100644 src/com/android/settings/development/TransparentNavigationBarPreferenceController.java create mode 100644 tests/robotests/src/com/android/settings/development/TransparentNavigationBarPreferenceControllerTest.java diff --git a/res/xml/development_settings.xml b/res/xml/development_settings.xml index ae93eed13ae..33364bf25cb 100644 --- a/res/xml/development_settings.xml +++ b/res/xml/development_settings.xml @@ -505,6 +505,11 @@ android:title="@string/display_cutout_emulation" settings:keywords="@string/display_cutout_emulation_keywords" /> + + Date: Wed, 1 Mar 2023 12:34:54 +0000 Subject: [PATCH 2/5] Add config for display Cloned Apps page in Settings. Bug: 266548680 Test: manual Change-Id: I6a89813dd266591ef001f9fc4ef2fde9427818c0 --- res/values/config.xml | 3 +++ .../settings/applications/ClonedAppsPreferenceController.java | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/res/values/config.xml b/res/values/config.xml index ad92e76d895..43643d35266 100755 --- a/res/values/config.xml +++ b/res/values/config.xml @@ -698,4 +698,7 @@ false + + + false diff --git a/src/com/android/settings/applications/ClonedAppsPreferenceController.java b/src/com/android/settings/applications/ClonedAppsPreferenceController.java index 2b6ab5d05a1..fd6bfe03be0 100644 --- a/src/com/android/settings/applications/ClonedAppsPreferenceController.java +++ b/src/com/android/settings/applications/ClonedAppsPreferenceController.java @@ -56,7 +56,9 @@ public class ClonedAppsPreferenceController extends BasePreferenceController @Override public int getAvailabilityStatus() { return DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_APP_CLONING, - PROPERTY_CLONED_APPS_ENABLED, false) ? AVAILABLE : UNSUPPORTED_ON_DEVICE; + PROPERTY_CLONED_APPS_ENABLED, false) + && mContext.getResources().getBoolean(R.bool.config_cloned_apps_page_enabled) + ? AVAILABLE : UNSUPPORTED_ON_DEVICE; } @Override From dbaea0f1c28f5c88ad3d1bbceca0d096f004f058 Mon Sep 17 00:00:00 2001 From: Candice Lo Date: Tue, 7 Mar 2023 15:42:29 +0000 Subject: [PATCH 3/5] Set the settings key when the font size is changed The key ACCESSIBILITY_FONT_SCALING_HAS_BEEN_CHANGED will be always ON after users modify the font size for the first time. Bug: 269679768 Test: make RunSettingsRoboTests ROBOTEST_FILTER=FontSizeDataTest Change-Id: I382e4ecd3c335d7b046f157cedc093fc40c3a77a --- .../settings/accessibility/FontSizeData.java | 9 +++++++++ .../accessibility/FontSizeDataTest.java | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/src/com/android/settings/accessibility/FontSizeData.java b/src/com/android/settings/accessibility/FontSizeData.java index 88aa1aa99ce..1226d25b0e3 100644 --- a/src/com/android/settings/accessibility/FontSizeData.java +++ b/src/com/android/settings/accessibility/FontSizeData.java @@ -16,6 +16,9 @@ package com.android.settings.accessibility; +import static com.android.settings.accessibility.AccessibilityUtil.State.OFF; +import static com.android.settings.accessibility.AccessibilityUtil.State.ON; + import android.content.ContentResolver; import android.content.Context; import android.content.res.Resources; @@ -50,6 +53,12 @@ final class FontSizeData extends PreviewSizeData { @Override void commit(int currentProgress) { final ContentResolver resolver = getContext().getContentResolver(); + if (Settings.Secure.getInt(resolver, + Settings.Secure.ACCESSIBILITY_FONT_SCALING_HAS_BEEN_CHANGED, + /* def= */ OFF) != ON) { + Settings.Secure.putInt(resolver, + Settings.Secure.ACCESSIBILITY_FONT_SCALING_HAS_BEEN_CHANGED, ON); + } Settings.System.putFloat(resolver, Settings.System.FONT_SCALE, getValues().get(currentProgress)); } diff --git a/tests/robotests/src/com/android/settings/accessibility/FontSizeDataTest.java b/tests/robotests/src/com/android/settings/accessibility/FontSizeDataTest.java index 7e357140811..adf7495a069 100644 --- a/tests/robotests/src/com/android/settings/accessibility/FontSizeDataTest.java +++ b/tests/robotests/src/com/android/settings/accessibility/FontSizeDataTest.java @@ -16,6 +16,9 @@ package com.android.settings.accessibility; +import static com.android.settings.accessibility.AccessibilityUtil.State.OFF; +import static com.android.settings.accessibility.AccessibilityUtil.State.ON; + import static com.google.common.truth.Truth.assertThat; import android.content.Context; @@ -52,4 +55,19 @@ public class FontSizeDataTest { assertThat(currentScale).isEqualTo(mFontSizeData.getValues().get(progress)); } + + @Test + public void commit_fontScalingHasBeenChangedIsOn() { + final int progress = 3; + Settings.Secure.putInt(mContext.getContentResolver(), + Settings.Secure.ACCESSIBILITY_FONT_SCALING_HAS_BEEN_CHANGED, OFF); + + mFontSizeData.commit(progress); + final int currentSettings = Settings.Secure.getInt( + mContext.getContentResolver(), + Settings.Secure.ACCESSIBILITY_FONT_SCALING_HAS_BEEN_CHANGED, + /* def= */ OFF); + + assertThat(currentSettings).isEqualTo(ON); + } } From 6f9062297f6c70b60a5da92096c352a719079de4 Mon Sep 17 00:00:00 2001 From: Patrick Rohr Date: Wed, 8 Mar 2023 00:54:52 +0000 Subject: [PATCH 4/5] settings: allow enabling ethernet tethering independent of link state A user should be able to enable tethering even if the interface does not have link yet. Therefore, the toggle should be active if any interface is available, independent of its link state. Test: TH Bug: 234036868 Change-Id: I2ae25207a766d71217dd6d17f3f9b74ceb261238 --- .../settings/network/EthernetTetherPreferenceController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/settings/network/EthernetTetherPreferenceController.java b/src/com/android/settings/network/EthernetTetherPreferenceController.java index 17b4b021315..6024839ca77 100644 --- a/src/com/android/settings/network/EthernetTetherPreferenceController.java +++ b/src/com/android/settings/network/EthernetTetherPreferenceController.java @@ -50,7 +50,7 @@ public final class EthernetTetherPreferenceController extends TetherBasePreferen @OnLifecycleEvent(Lifecycle.Event.ON_START) public void onStart() { mEthernetListener = (iface, state, role, configuration) -> { - if (state == EthernetManager.STATE_LINK_UP) { + if (state != EthernetManager.STATE_ABSENT) { mAvailableInterfaces.add(iface); } else { mAvailableInterfaces.remove(iface); From 0aba4e342a748b5051990e2b06a40251846b620d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Hern=C3=A1ndez?= Date: Wed, 8 Mar 2023 12:43:06 +0100 Subject: [PATCH 5/5] Fix failing checkcolor_hook in Settings (Fixed according to the instructions in prebuilts/checkcolor/README.md). Fixes: 272244692 Test: repo upload Change-Id: Ib53c6b302984250e6c4dfe058a74697a62b94e26 --- color-check-baseline.xml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/color-check-baseline.xml b/color-check-baseline.xml index 3ba943b8e90..911a95b5001 100644 --- a/color-check-baseline.xml +++ b/color-check-baseline.xml @@ -4477,6 +4477,22 @@ column="13"/> + + + +