From 1fd847de4aaa4a085421f939a55693524294e8d8 Mon Sep 17 00:00:00 2001 From: Jack Yu Date: Thu, 30 Jan 2025 23:33:35 -0800 Subject: [PATCH 01/17] Cleaned up the flag enable_modem_cipher_transparency Cleaned up the 24Q3 flag enable_modem_cipher_transparency Bug: 283336425 Test: Basic telephony functionality tests Test: atest FrameworksTelephonyTests Flag: EXEMPT removing flag Change-Id: Ibdb3613d4633535a2d855cc0383c05315ef4e890 --- .../settings/network/CellularSecurityPreferenceController.java | 3 +-- .../CellularSecurityNotificationsDividerController.java | 3 +-- .../CellularSecurityNotificationsPreferenceController.java | 3 +-- .../network/CellularSecurityPreferenceControllerTest.java | 2 -- .../CellularSecurityNotificationsDividerControllerTest.java | 2 -- .../CellularSecurityNotificationsPreferenceControllerTest.java | 2 -- 6 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/com/android/settings/network/CellularSecurityPreferenceController.java b/src/com/android/settings/network/CellularSecurityPreferenceController.java index b36e35c15c5..6ab32e31729 100644 --- a/src/com/android/settings/network/CellularSecurityPreferenceController.java +++ b/src/com/android/settings/network/CellularSecurityPreferenceController.java @@ -72,8 +72,7 @@ public class CellularSecurityPreferenceController extends BasePreferenceControll @Override public int getAvailabilityStatus() { if (!mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEPHONY) - || !Flags.enableModemCipherTransparencyUnsolEvents() - || !Flags.enableModemCipherTransparency()) { + || !Flags.enableModemCipherTransparencyUnsolEvents()) { return UNSUPPORTED_ON_DEVICE; } if (mTelephonyManager == null) { diff --git a/src/com/android/settings/network/telephony/CellularSecurityNotificationsDividerController.java b/src/com/android/settings/network/telephony/CellularSecurityNotificationsDividerController.java index 4ff92abaee3..8d498e2619c 100644 --- a/src/com/android/settings/network/telephony/CellularSecurityNotificationsDividerController.java +++ b/src/com/android/settings/network/telephony/CellularSecurityNotificationsDividerController.java @@ -60,8 +60,7 @@ public class CellularSecurityNotificationsDividerController extends @Override public int getAvailabilityStatus() { - if (!Flags.enableModemCipherTransparencyUnsolEvents() - || !Flags.enableModemCipherTransparency()) { + if (!Flags.enableModemCipherTransparencyUnsolEvents()) { return UNSUPPORTED_ON_DEVICE; } if (!isSafetyCenterSupported()) { diff --git a/src/com/android/settings/network/telephony/CellularSecurityNotificationsPreferenceController.java b/src/com/android/settings/network/telephony/CellularSecurityNotificationsPreferenceController.java index b7325260e2e..6b18f3c4b18 100644 --- a/src/com/android/settings/network/telephony/CellularSecurityNotificationsPreferenceController.java +++ b/src/com/android/settings/network/telephony/CellularSecurityNotificationsPreferenceController.java @@ -178,8 +178,7 @@ public class CellularSecurityNotificationsPreferenceController extends } private boolean areFlagsEnabled() { - if (!Flags.enableModemCipherTransparencyUnsolEvents() - || !Flags.enableModemCipherTransparency()) { + if (!Flags.enableModemCipherTransparencyUnsolEvents()) { return false; } return true; diff --git a/tests/unit/src/com/android/settings/network/CellularSecurityPreferenceControllerTest.java b/tests/unit/src/com/android/settings/network/CellularSecurityPreferenceControllerTest.java index 3e6ca5091c8..05ca990e789 100644 --- a/tests/unit/src/com/android/settings/network/CellularSecurityPreferenceControllerTest.java +++ b/tests/unit/src/com/android/settings/network/CellularSecurityPreferenceControllerTest.java @@ -136,10 +136,8 @@ public final class CellularSecurityPreferenceControllerTest { private void enableFlags(boolean enabled) { if (enabled) { - mSetFlagsRule.enableFlags(Flags.FLAG_ENABLE_MODEM_CIPHER_TRANSPARENCY); } else { mSetFlagsRule.disableFlags(Flags.FLAG_ENABLE_MODEM_CIPHER_TRANSPARENCY_UNSOL_EVENTS); - mSetFlagsRule.disableFlags(Flags.FLAG_ENABLE_MODEM_CIPHER_TRANSPARENCY); } } } diff --git a/tests/unit/src/com/android/settings/network/telephony/CellularSecurityNotificationsDividerControllerTest.java b/tests/unit/src/com/android/settings/network/telephony/CellularSecurityNotificationsDividerControllerTest.java index 9bd25f4fcf3..516c1970d0b 100644 --- a/tests/unit/src/com/android/settings/network/telephony/CellularSecurityNotificationsDividerControllerTest.java +++ b/tests/unit/src/com/android/settings/network/telephony/CellularSecurityNotificationsDividerControllerTest.java @@ -114,10 +114,8 @@ public class CellularSecurityNotificationsDividerControllerTest { private void enableFlags(boolean enabled) { if (enabled) { mSetFlagsRule.enableFlags(Flags.FLAG_ENABLE_MODEM_CIPHER_TRANSPARENCY_UNSOL_EVENTS); - mSetFlagsRule.enableFlags(Flags.FLAG_ENABLE_MODEM_CIPHER_TRANSPARENCY); } else { mSetFlagsRule.disableFlags(Flags.FLAG_ENABLE_MODEM_CIPHER_TRANSPARENCY_UNSOL_EVENTS); - mSetFlagsRule.disableFlags(Flags.FLAG_ENABLE_MODEM_CIPHER_TRANSPARENCY); } } } diff --git a/tests/unit/src/com/android/settings/network/telephony/CellularSecurityNotificationsPreferenceControllerTest.java b/tests/unit/src/com/android/settings/network/telephony/CellularSecurityNotificationsPreferenceControllerTest.java index 7d9ff9e73b2..fd67b7219f6 100644 --- a/tests/unit/src/com/android/settings/network/telephony/CellularSecurityNotificationsPreferenceControllerTest.java +++ b/tests/unit/src/com/android/settings/network/telephony/CellularSecurityNotificationsPreferenceControllerTest.java @@ -217,10 +217,8 @@ public class CellularSecurityNotificationsPreferenceControllerTest { private void enableFlags(boolean enabled) { if (enabled) { mSetFlagsRule.enableFlags(Flags.FLAG_ENABLE_MODEM_CIPHER_TRANSPARENCY_UNSOL_EVENTS); - mSetFlagsRule.enableFlags(Flags.FLAG_ENABLE_MODEM_CIPHER_TRANSPARENCY); } else { mSetFlagsRule.disableFlags(Flags.FLAG_ENABLE_MODEM_CIPHER_TRANSPARENCY_UNSOL_EVENTS); - mSetFlagsRule.disableFlags(Flags.FLAG_ENABLE_MODEM_CIPHER_TRANSPARENCY); } } } From d13be243666be2e7464c0e744acacda128284bc7 Mon Sep 17 00:00:00 2001 From: Wes Okuhara Date: Fri, 31 Jan 2025 12:11:07 -0800 Subject: [PATCH 02/17] Settings: Add tethering strings for device product type For products that have the "device" type, define tethering strings that do not use the default "phone" string. Bug: 393312760 Test: Manually verify UI. See screenshot in bug. Flag: EXEMPT bugfix Change-Id: I1e8bf814220d5414e4138fab018bd3593e96bcb6 --- res-product/values/strings.xml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/res-product/values/strings.xml b/res-product/values/strings.xml index 13061b53c35..c121406a03f 100644 --- a/res-product/values/strings.xml +++ b/res-product/values/strings.xml @@ -513,14 +513,19 @@ Erase all data Share phone\u2019s internet connection via USB Share tablet\u2019s internet connection via USB - - Share tablet\u2019s internet connection via Bluetooth + Share device\u2019s internet connection via USB Share phone\u2019s internet connection via Bluetooth + + Share tablet\u2019s internet connection via Bluetooth + + Share device\u2019s internet connection via Bluetooth Share phone\u2019s internet connection via Ethernet Share tablet\u2019s internet connection via Ethernet + + Share device\u2019s internet connection via Ethernet About tablet From 3e0623bd7e6bad683d1677fcf0f463e848bcb4bd Mon Sep 17 00:00:00 2001 From: Yining Liu Date: Fri, 31 Jan 2025 15:19:17 -0800 Subject: [PATCH 03/17] Fix the test failures for the new lock screen notifications settings page Fix the old tests that fail when the new lock screen notifications settings page flag is enabled. Fix: 393631085 Flag: com.android.server.notification.notification_lock_screen_settings Test: LockscreenNotificationMinimalismPreferenceControllerTest, RedactNotificationPreferenceControllerTest, ShowOnlyUnseenNotificationsOnLockscreenPreferenceControllerTest Change-Id: I427ce675721c6d4df6451deebfcb6e4c06c72c37 --- ...ionMinimalismPreferenceControllerTest.java | 34 ++++++++++++++++--- ...tNotificationPreferenceControllerTest.java | 12 ++++++- ...sOnLockscreenPreferenceControllerTest.java | 12 +++++-- 3 files changed, 50 insertions(+), 8 deletions(-) diff --git a/tests/robotests/src/com/android/settings/notification/LockscreenNotificationMinimalismPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/LockscreenNotificationMinimalismPreferenceControllerTest.java index 86dc06fc4d1..299ffc41709 100644 --- a/tests/robotests/src/com/android/settings/notification/LockscreenNotificationMinimalismPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/notification/LockscreenNotificationMinimalismPreferenceControllerTest.java @@ -17,6 +17,10 @@ package com.android.settings.notification; import static android.provider.Settings.Secure.LOCK_SCREEN_NOTIFICATION_MINIMALISM; +import static android.provider.Settings.Secure.LOCK_SCREEN_SHOW_NOTIFICATIONS; + +import static com.android.settings.core.BasePreferenceController.AVAILABLE; +import static com.android.settings.core.BasePreferenceController.CONDITIONALLY_UNAVAILABLE; import static com.google.common.truth.Truth.assertThat; @@ -34,6 +38,8 @@ import android.provider.Settings; import androidx.preference.Preference; import androidx.preference.PreferenceScreen; +import com.android.server.notification.Flags; + import org.junit.Before; import org.junit.Rule; import org.junit.Test; @@ -44,9 +50,15 @@ import org.mockito.MockitoAnnotations; import org.robolectric.RobolectricTestRunner; import org.robolectric.RuntimeEnvironment; +/** + * Disable FLAG_NOTIFICATION_LOCK_SCREEN_SETTINGS because this toggle will be replaced by the new + * settings page. + */ @RunWith(RobolectricTestRunner.class) +@DisableFlags(Flags.FLAG_NOTIFICATION_LOCK_SCREEN_SETTINGS) public class LockscreenNotificationMinimalismPreferenceControllerTest { - + @Rule + public final SetFlagsRule mSetFlagsRule = new SetFlagsRule(); @Mock(answer = Answers.RETURNS_DEEP_STUBS) private Context mContext; @Mock(answer = Answers.RETURNS_DEEP_STUBS) @@ -56,8 +68,6 @@ public class LockscreenNotificationMinimalismPreferenceControllerTest { private Preference mPreference; static final int ON = 1; static final int OFF = 0; - @Rule - public final SetFlagsRule mSetFlagsRule = new SetFlagsRule(); @Before public void setUp() { @@ -72,17 +82,33 @@ public class LockscreenNotificationMinimalismPreferenceControllerTest { } @Test - @DisableFlags(com.android.server.notification.Flags.FLAG_NOTIFICATION_MINIMALISM) + @DisableFlags(Flags.FLAG_NOTIFICATION_MINIMALISM) public void display_featureFlagOff_shouldNotDisplay() { + // Given: lockscreen show notifications, FLAG_NOTIFICATION_MINIMALISM is disabled + Settings.Secure.putInt(mContext.getContentResolver(), + LOCK_SCREEN_SHOW_NOTIFICATIONS, ON); + + // When: displayPreference mController.displayPreference(mScreen); + + // Then: The controller is CONDITIONALLY_UNAVAILABLE, preference is not visible assertThat(mPreference.isVisible()).isFalse(); + assertThat(mController.getAvailabilityStatus()).isEqualTo(CONDITIONALLY_UNAVAILABLE); } @Test @EnableFlags(com.android.server.notification.Flags.FLAG_NOTIFICATION_MINIMALISM) public void display_featureFlagOn_shouldDisplay() { + // Given: lockscreen show notifications, FLAG_NOTIFICATION_MINIMALISM is enabled + Settings.Secure.putInt(mContext.getContentResolver(), + LOCK_SCREEN_SHOW_NOTIFICATIONS, ON); + + // When: displayPreference mController.displayPreference(mScreen); + + // Then: The controller is AVAILABLE, preference is visible assertThat(mPreference.isVisible()).isTrue(); + assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE); } @Test diff --git a/tests/robotests/src/com/android/settings/notification/RedactNotificationPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/RedactNotificationPreferenceControllerTest.java index 8304d82be9f..c34796b2fd5 100644 --- a/tests/robotests/src/com/android/settings/notification/RedactNotificationPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/notification/RedactNotificationPreferenceControllerTest.java @@ -37,11 +37,14 @@ import android.content.Context; import android.content.pm.UserInfo; import android.os.UserHandle; import android.os.UserManager; +import android.platform.test.annotations.DisableFlags; +import android.platform.test.flag.junit.SetFlagsRule; import android.provider.Settings; import androidx.preference.PreferenceScreen; import com.android.internal.widget.LockPatternUtils; +import com.android.server.notification.Flags; import com.android.settings.testutils.FakeFeatureFactory; import com.android.settings.testutils.shadow.ShadowRestrictedLockUtilsInternal; import com.android.settings.testutils.shadow.ShadowUtils; @@ -49,6 +52,7 @@ import com.android.settingslib.RestrictedSwitchPreference; import org.junit.After; import org.junit.Before; +import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; @@ -59,13 +63,19 @@ import org.robolectric.annotation.Config; import java.util.Arrays; +/** + * Disable FLAG_NOTIFICATION_LOCK_SCREEN_SETTINGS because this toggle will be replaced by the new + * settings page. + */ @RunWith(RobolectricTestRunner.class) @Config(shadows = { ShadowUtils.class, ShadowRestrictedLockUtilsInternal.class, }) +@DisableFlags(Flags.FLAG_NOTIFICATION_LOCK_SCREEN_SETTINGS) public class RedactNotificationPreferenceControllerTest { - + @Rule + public final SetFlagsRule mSetFlagsRule = new SetFlagsRule(); @Mock private DevicePolicyManager mDpm; @Mock diff --git a/tests/robotests/src/com/android/settings/notification/ShowOnlyUnseenNotificationsOnLockscreenPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/ShowOnlyUnseenNotificationsOnLockscreenPreferenceControllerTest.java index 8877f300e22..b72c1765a63 100644 --- a/tests/robotests/src/com/android/settings/notification/ShowOnlyUnseenNotificationsOnLockscreenPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/notification/ShowOnlyUnseenNotificationsOnLockscreenPreferenceControllerTest.java @@ -37,6 +37,8 @@ import android.provider.Settings; import androidx.preference.Preference; import androidx.preference.PreferenceScreen; +import com.android.server.notification.Flags; + import org.junit.Before; import org.junit.Rule; import org.junit.Test; @@ -47,9 +49,15 @@ import org.mockito.MockitoAnnotations; import org.robolectric.RobolectricTestRunner; import org.robolectric.RuntimeEnvironment; +/** + * Disable FLAG_NOTIFICATION_LOCK_SCREEN_SETTINGS because this toggle will be replaced by the new + * settings page. + */ @RunWith(RobolectricTestRunner.class) +@DisableFlags(Flags.FLAG_NOTIFICATION_LOCK_SCREEN_SETTINGS) public class ShowOnlyUnseenNotificationsOnLockscreenPreferenceControllerTest { - + @Rule + public final SetFlagsRule mSetFlagsRule = new SetFlagsRule(); @Mock(answer = Answers.RETURNS_DEEP_STUBS) private Context mContext; @Mock(answer = Answers.RETURNS_DEEP_STUBS) @@ -57,8 +65,6 @@ public class ShowOnlyUnseenNotificationsOnLockscreenPreferenceControllerTest { private ShowOnlyUnseenNotificationsOnLockscreenPreferenceController mController; private Preference mPreference; - @Rule - public final SetFlagsRule mSetFlagsRule = new SetFlagsRule(); @Before public void setUp() { From 07af74a52e311628f2169a3007cda8fc28ca115b Mon Sep 17 00:00:00 2001 From: Daniel Norman Date: Thu, 30 Jan 2025 09:36:38 -0800 Subject: [PATCH 04/17] Adjust A11y Shortcut settings to use lowercase shortcut names. Per go/android-naming these strings should be lowercase when used in the middle of a sentence because they are generic descriptive names and not branded names. Bug: none Change-Id: I0508a5cbdba20a1bd2d6db66e0e7183845e503ad Test: build & install & check string Flag: EXEMPT low risk bugfix --- .../AccessibilityButtonPreferenceController.java | 4 +++- .../HardwareShortcutFromLockscreenPreferenceController.java | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/com/android/settings/accessibility/AccessibilityButtonPreferenceController.java b/src/com/android/settings/accessibility/AccessibilityButtonPreferenceController.java index d9ee3cd31f7..fa052db041c 100644 --- a/src/com/android/settings/accessibility/AccessibilityButtonPreferenceController.java +++ b/src/com/android/settings/accessibility/AccessibilityButtonPreferenceController.java @@ -31,6 +31,7 @@ import com.android.settings.core.BasePreferenceController; import com.android.settingslib.search.SearchIndexableRaw; import java.util.List; +import java.util.Locale; /** * Preference controller for accessibility button preference. @@ -67,7 +68,8 @@ public class AccessibilityButtonPreferenceController extends BasePreferenceContr } else { return mContext.getString( R.string.accessibility_shortcut_unassigned_setting_unavailable_summary, - AccessibilityUtil.getShortcutSummaryList(mContext, SOFTWARE)); + AccessibilityUtil.getShortcutSummaryList(mContext, SOFTWARE) + .toString().toLowerCase(Locale.getDefault())); } } diff --git a/src/com/android/settings/accessibility/HardwareShortcutFromLockscreenPreferenceController.java b/src/com/android/settings/accessibility/HardwareShortcutFromLockscreenPreferenceController.java index a6d5b7bc7fe..3c9047180b4 100644 --- a/src/com/android/settings/accessibility/HardwareShortcutFromLockscreenPreferenceController.java +++ b/src/com/android/settings/accessibility/HardwareShortcutFromLockscreenPreferenceController.java @@ -31,6 +31,8 @@ import androidx.preference.Preference; import com.android.settings.R; import com.android.settings.core.TogglePreferenceController; +import java.util.Locale; + /** * Setting to allow the hardware shortcut to turn on from the lock screen */ @@ -87,7 +89,8 @@ public class HardwareShortcutFromLockscreenPreferenceController } else { return mContext.getString( R.string.accessibility_shortcut_unassigned_setting_unavailable_summary, - AccessibilityUtil.getShortcutSummaryList(mContext, HARDWARE)); + AccessibilityUtil.getShortcutSummaryList(mContext, HARDWARE) + .toString().toLowerCase(Locale.getDefault())); } } From ea9855d17b7d0a02b6835a0e8db5e8aea96a2a4a Mon Sep 17 00:00:00 2001 From: Sunny Shao Date: Wed, 18 Dec 2024 17:19:04 +0800 Subject: [PATCH 05/17] [E2E] Update the Settings Homepage for new E2E rule This windowOptOutEdgeToEdgeEnforcement attribute doesn't support in 25Q2. Modify Settings Homepage to apply new rule of the Edge-to-Edge. Test: manual test Bug: 333998128 Flag: EXEMPT bugfix Change-Id: Idd3bbc94813d35044814115a7ece6f1787095f67 --- res/layout/settings_homepage_container_v2.xml | 2 +- res/values/dimens.xml | 1 + res/values/themes.xml | 3 --- .../homepage/SettingsHomepageActivity.java | 16 ++++++++++++---- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/res/layout/settings_homepage_container_v2.xml b/res/layout/settings_homepage_container_v2.xml index a67b743ce13..c68ddaf53c6 100644 --- a/res/layout/settings_homepage_container_v2.xml +++ b/res/layout/settings_homepage_container_v2.xml @@ -69,7 +69,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" - android:paddingTop="8dp" + android:paddingTop="@dimen/search_bar_container_top_padding" android:paddingBottom="16dp" android:paddingStart="?android:attr/listPreferredItemPaddingStart" android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"> diff --git a/res/values/dimens.xml b/res/values/dimens.xml index 1f4a555b0eb..3bdea5abfe5 100755 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -87,6 +87,7 @@ 24dp -4dp 8dp + 8dp 48dp diff --git a/res/values/themes.xml b/res/values/themes.xml index ee15d76572e..a003870b84e 100644 --- a/res/values/themes.xml +++ b/res/values/themes.xml @@ -190,9 +190,6 @@ @android:color/white - - - true