Remove the unused variables and @deprecated function in Color Inversion quick settings

- SlashState is not used anymore
- composeChangeAnnouncement is @deprecated function and not used anymore
- Unused variables

Bug: 211937943
Test: manually test color inversion quick settings tile actions
Test: atest SystemUITests
Change-Id: I4c235d1e80993d712f2895e8fa1ea0dcfe01d7e9
This commit is contained in:
menghanli
2021-12-24 12:11:46 +08:00
parent 72beecddc1
commit 940e92ab37
2 changed files with 0 additions and 25 deletions

View File

@@ -465,10 +465,6 @@
<string name="accessibility_quick_settings_flashlight_changed_off">Flashlight turned off.</string>
<!-- Announcement made when the flashlight state changes to on (not shown on the screen). [CHAR LIMIT=NONE] -->
<string name="accessibility_quick_settings_flashlight_changed_on">Flashlight turned on.</string>
<!-- Announcement made when the color inversion state changes to off (not shown on the screen). [CHAR LIMIT=NONE] -->
<string name="accessibility_quick_settings_color_inversion_changed_off">Color inversion turned off.</string>
<!-- Announcement made when the color inversion state changes to on (not shown on the screen). [CHAR LIMIT=NONE] -->
<string name="accessibility_quick_settings_color_inversion_changed_on">Color inversion turned on.</string>
<!-- Announcement made when the hotspot state changes to off (not shown on the screen). [CHAR LIMIT=NONE] -->
<string name="accessibility_quick_settings_hotspot_changed_off">Mobile hotspot turned off.</string>
<!-- Announcement made when the hotspot state changes to on (not shown on the screen). [CHAR LIMIT=NONE] -->

View File

@@ -49,15 +49,9 @@ import javax.inject.Inject;
/** Quick settings tile: Invert colors **/
public class ColorInversionTile extends QSTileImpl<BooleanState> {
private static final String EXTRA_FRAGMENT_ARGS_KEY = ":settings:fragment_args_key";
private static final String EXTRA_SHOW_FRAGMENT_ARGS_KEY = ":settings:show_fragment_args";
private static final String COLOR_INVERSION_PREFERENCE_KEY = "toggle_inversion_preference";
private final Icon mIcon = ResourceIcon.get(drawable.ic_invert_colors);
private final SettingObserver mSetting;
private boolean mListening;
@Inject
public ColorInversionTile(
QSHost host,
@@ -126,11 +120,7 @@ public class ColorInversionTile extends QSTileImpl<BooleanState> {
protected void handleUpdateState(BooleanState state, Object arg) {
final int value = arg instanceof Integer ? (Integer) arg : mSetting.getValue();
final boolean enabled = value != 0;
if (state.slash == null) {
state.slash = new SlashState();
}
state.value = enabled;
state.slash.isSlashed = !state.value;
state.state = state.value ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE;
state.label = mContext.getString(R.string.quick_settings_inversion_label);
state.icon = mIcon;
@@ -142,15 +132,4 @@ public class ColorInversionTile extends QSTileImpl<BooleanState> {
public int getMetricsCategory() {
return MetricsEvent.QS_COLORINVERSION;
}
@Override
protected String composeChangeAnnouncement() {
if (mState.value) {
return mContext.getString(
R.string.accessibility_quick_settings_color_inversion_changed_on);
} else {
return mContext.getString(
R.string.accessibility_quick_settings_color_inversion_changed_off);
}
}
}