Don't show quick settings tooltip if the user is in the Setup Wizard,

since the user can't access the Quick Settings Panel.

Bug: 294560581
Test: manual
- Turn on feature flag: adb shell device_config put accessibility com.android.settings.accessibility.remove_qs_tooltip_in_suw true
- Modify the font scale in SUW, verify the QS tooltip doesn't show up
- Modify the font scale after SUW, verify the QS tooltip shows up
Test: atest SettingsRoboTests:com.android.settings.accessibility

Change-Id: I1d1a4f8f70ea3e1d929952d5c273de1b4cd80503
This commit is contained in:
Chun-Ku Lin
2023-11-10 20:43:58 +00:00
parent 24c989a070
commit 0f2cc34230
9 changed files with 100 additions and 6 deletions

View File

@@ -60,6 +60,8 @@ import com.android.settings.flags.Flags;
import com.android.settings.testutils.shadow.ShadowFragment;
import com.android.settingslib.widget.TopIntroPreference;
import com.google.android.setupcompat.util.WizardManagerHelper;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -301,6 +303,20 @@ public class ToggleFeaturePreferenceFragmentTest {
assertThat(getLatestPopupWindow().isShowing()).isTrue();
}
@Test
@RequiresFlagsEnabled(com.android.settings.accessibility.Flags.FLAG_REMOVE_QS_TOOLTIP_IN_SUW)
@Config(shadows = ShadowFragment.class)
public void onPreferenceToggledOnEnabledService_inSuw_toolTipViewShouldNotShow() {
Intent suwIntent = new Intent();
suwIntent.putExtra(WizardManagerHelper.EXTRA_IS_SETUP_FLOW, true);
when(mActivity.getIntent()).thenReturn(suwIntent);
mFragment.onPreferenceToggled(
ToggleFeaturePreferenceFragment.KEY_USE_SERVICE_PREFERENCE, /* enabled= */ true);
assertThat(getLatestPopupWindow()).isNull();
}
@Test
@Config(shadows = ShadowFragment.class)
public void onPreferenceToggledOnEnabledService_tooltipViewShown_notShowTooltipView() {