Cleaning up quick settings flag in Settings app

Removes all instances of a11y_qs_enabled. Any code that would be nontrivial to remove has been deprecated for later cleanup.

Test: atest com.android.settings.accessibility
Flag: EXEMPT flag cleanup
Bug: 367414968

Change-Id: I81f3c9cee377535eaa552a170d58ec1a79d1da65
This commit is contained in:
Riley Jones
2024-11-21 01:03:39 +00:00
parent e39b2c18d8
commit acccaff128
39 changed files with 159 additions and 1536 deletions

View File

@@ -26,7 +26,6 @@ import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -38,7 +37,6 @@ import android.content.Intent;
import android.content.pm.PackageManager;
import android.icu.text.CaseMap;
import android.os.Bundle;
import android.platform.test.annotations.DisableFlags;
import android.platform.test.annotations.EnableFlags;
import android.platform.test.flag.junit.SetFlagsRule;
import android.provider.Settings;
@@ -142,7 +140,6 @@ public class ToggleFeaturePreferenceFragmentTest {
}
@Test
@EnableFlags(android.view.accessibility.Flags.FLAG_A11Y_QS_SHORTCUT)
@Config(shadows = {ShadowFragment.class})
public void onResume_flagEnabled_haveRegisterToSpecificUris() {
mFragment.onAttach(mContext);
@@ -166,31 +163,6 @@ public class ToggleFeaturePreferenceFragmentTest {
any(AccessibilitySettingsContentObserver.class));
}
@Test
@DisableFlags(android.view.accessibility.Flags.FLAG_A11Y_QS_SHORTCUT)
@Config(shadows = {ShadowFragment.class})
public void onResume_flagDisabled_haveRegisterToSpecificUris() {
mFragment.onAttach(mContext);
mFragment.onCreate(Bundle.EMPTY);
mFragment.onResume();
verify(mContentResolver).registerContentObserver(
eq(Settings.Secure.getUriFor(Settings.Secure.ACCESSIBILITY_BUTTON_TARGETS)),
eq(false),
any(AccessibilitySettingsContentObserver.class));
verify(mContentResolver).registerContentObserver(
eq(Settings.Secure.getUriFor(
Settings.Secure.ACCESSIBILITY_SHORTCUT_TARGET_SERVICE)),
eq(false),
any(AccessibilitySettingsContentObserver.class));
verify(mContentResolver, never()).registerContentObserver(
eq(Settings.Secure.getUriFor(
Settings.Secure.ACCESSIBILITY_QS_TARGETS)),
eq(false),
any(AccessibilitySettingsContentObserver.class));
}
@Test
public void updateShortcutPreferenceData_assignDefaultValueToVariable() {
mFragment.mComponentName = PLACEHOLDER_COMPONENT_NAME;
@@ -240,15 +212,6 @@ public class ToggleFeaturePreferenceFragmentTest {
assertThat(getLatestPopupWindow()).isNull();
}
@Test
@DisableFlags(android.view.accessibility.Flags.FLAG_A11Y_QS_SHORTCUT)
@Config(shadows = ShadowFragment.class)
public void onPreferenceToggledOnEnabledService_showTooltipView() {
mFragment.onPreferenceToggled(mFragment.getUseServicePreferenceKey(), /* enabled= */ true);
assertThat(getLatestPopupWindow().isShowing()).isTrue();
}
@Test
@Config(shadows = ShadowFragment.class)
public void onPreferenceToggledOnEnabledService_inSuw_toolTipViewShouldNotShow() {
@@ -261,18 +224,6 @@ public class ToggleFeaturePreferenceFragmentTest {
assertThat(getLatestPopupWindow()).isNull();
}
@Test
@DisableFlags(android.view.accessibility.Flags.FLAG_A11Y_QS_SHORTCUT)
@Config(shadows = ShadowFragment.class)
public void onPreferenceToggledOnEnabledService_tooltipViewShown_notShowTooltipView() {
mFragment.onPreferenceToggled(mFragment.getUseServicePreferenceKey(), /* enabled= */ true);
getLatestPopupWindow().dismiss();
mFragment.onPreferenceToggled(mFragment.getUseServicePreferenceKey(), /* enabled= */ true);
assertThat(getLatestPopupWindow().isShowing()).isFalse();
}
@Test
public void initTopIntroPreference_hasTopIntroTitle_shouldSetAsExpectedValue() {
mFragment.mTopIntroTitle = DEFAULT_TOP_INTRO;
@@ -365,7 +316,6 @@ public class ToggleFeaturePreferenceFragmentTest {
}
@Test
@EnableFlags(android.view.accessibility.Flags.FLAG_A11Y_QS_SHORTCUT)
@Config(shadows = ShadowFragment.class)
public void showQuickSettingsTooltipIfNeeded_qsFlagOn_dontShowTooltipView() {
mFragment.showQuickSettingsTooltipIfNeeded(QuickSettingsTooltipType.GUIDE_TO_EDIT);
@@ -374,7 +324,6 @@ public class ToggleFeaturePreferenceFragmentTest {
}
@Test
@EnableFlags(android.view.accessibility.Flags.FLAG_A11Y_QS_SHORTCUT)
public void getShortcutTypeSummary_shortcutSummaryIsCorrectlySet() {
final PreferredShortcut userPreferredShortcut = new PreferredShortcut(
PLACEHOLDER_COMPONENT_NAME.flattenToString(),