Support extra dim quick settings tooltips when feature on

Bug: 210356011
Test: Manual testing
Change-Id: I501d21e00a1599a79f9490a5a6f4bd246c2ec8d4
This commit is contained in:
menghanli
2022-01-25 03:56:38 +08:00
parent 9e4a9d6742
commit 6892e89775

View File

@@ -16,6 +16,10 @@
package com.android.settings.accessibility;
import static com.android.internal.accessibility.AccessibilityShortcutController.REDUCE_BRIGHT_COLORS_COMPONENT_NAME;
import static com.android.internal.accessibility.AccessibilityShortcutController.REDUCE_BRIGHT_COLORS_TILE_SERVICE_COMPONENT_NAME;
import static com.android.settings.accessibility.AccessibilityStatsLogUtils.logAccessibilityServiceEnabled;
import android.app.settings.SettingsEnums;
import android.content.ComponentName;
import android.content.ContentResolver;
@@ -31,7 +35,6 @@ import android.view.ViewGroup;
import androidx.preference.PreferenceCategory;
import androidx.preference.SwitchPreference;
import com.android.internal.accessibility.AccessibilityShortcutController;
import com.android.settings.R;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.widget.SeekBarPreference;
@@ -62,7 +65,7 @@ public class ToggleReduceBrightColorsPreferenceFragment extends ToggleFeaturePre
.authority(getPrefContext().getPackageName())
.appendPath(String.valueOf(R.raw.extra_dim_banner))
.build();
mComponentName = AccessibilityShortcutController.REDUCE_BRIGHT_COLORS_COMPONENT_NAME;
mComponentName = REDUCE_BRIGHT_COLORS_COMPONENT_NAME;
mPackageName = getText(R.string.reduce_bright_colors_preference_title);
mHtmlDescription = getText(R.string.reduce_bright_colors_preference_subtitle);
mRbcIntensityPreferenceController =
@@ -143,7 +146,8 @@ public class ToggleReduceBrightColorsPreferenceFragment extends ToggleFeaturePre
@Override
protected void onPreferenceToggled(String preferenceKey, boolean enabled) {
AccessibilityStatsLogUtils.logAccessibilityServiceEnabled(mComponentName, enabled);
super.onPreferenceToggled(preferenceKey, enabled);
logAccessibilityServiceEnabled(mComponentName, enabled);
mColorDisplayManager.setReduceBrightColorsActivated(enabled);
}
@@ -172,12 +176,12 @@ public class ToggleReduceBrightColorsPreferenceFragment extends ToggleFeaturePre
@Override
ComponentName getTileComponentName() {
return null;
return REDUCE_BRIGHT_COLORS_TILE_SERVICE_COMPONENT_NAME;
}
@Override
CharSequence getTileName() {
return null;
return getText(R.string.reduce_bright_colors_preference_title);
}
@Override