Don't show the QuickSetting tooltip when we stopped auto add qs tile for

the user

Bug: 348110750
Test: atest ReduceBrightColorsPreferenceControllerTest
Test: manual
- Go to Settings > Accessibility
- Turn on Extra dim for the first time
- Verify the QS tooltip prompt doesn't show up
Flag: android.view.accessibility.a11y_qs_shortcut

Change-Id: I6fecb818df3bb865ba81cbcda94149a98d8255ab
This commit is contained in:
Chun-Ku Lin
2024-06-20 22:30:34 +00:00
parent df43d049d4
commit 764f8d73a4
3 changed files with 33 additions and 1 deletions

View File

@@ -21,6 +21,7 @@ import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import androidx.annotation.Nullable;
import androidx.preference.PreferenceScreen;
import com.android.settings.R;
@@ -42,6 +43,7 @@ public abstract class AccessibilityQuickSettingsPrimarySwitchPreferenceControlle
private boolean mNeedsQSTooltipReshow = false;
/** Returns the accessibility tile component name. */
@Nullable
abstract ComponentName getTileComponentName();
/** Returns the accessibility tile tooltip content. */

View File

@@ -29,6 +29,7 @@ import android.os.UserHandle;
import android.provider.Settings;
import android.text.TextUtils;
import androidx.annotation.Nullable;
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
@@ -125,9 +126,14 @@ public class ReduceBrightColorsPreferenceController
mContext.getContentResolver().unregisterContentObserver(mSettingsContentObserver);
}
@Nullable
@Override
protected ComponentName getTileComponentName() {
return REDUCE_BRIGHT_COLORS_TILE_SERVICE_COMPONENT_NAME;
// TODO: When clean up the feature flag, change the parent class from
// AccessibilityQuickSettingsPrimarySwitchPreferenceController to
// TogglePreferenceController
return android.view.accessibility.Flags.a11yQsShortcut()
? null : REDUCE_BRIGHT_COLORS_TILE_SERVICE_COMPONENT_NAME;
}
@Override