Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3e5e8415 authored by Felipe Leme's avatar Felipe Leme
Browse files

Added Talkback announcements for Data Saver switch.

BUG: 27504554
Change-Id: I6a6b996fe03a565edc051cf24a8ec7de4e8e5644
parent 0997873e
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -523,6 +523,10 @@
    <string name="accessibility_quick_settings_work_mode_changed_off">Work mode turned off.</string>
    <!-- Announcement made when the work mode changes to on (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_quick_settings_work_mode_changed_on">Work mode turned on.</string>
    <!-- Announcement made when the Data Saver changes to off (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_quick_settings_data_saver_changed_off">Data Saver turned off.</string>
    <!-- Announcement made when the Data Saver changes to on (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_quick_settings_data_saver_changed_on">Data Saver turned on.</string>

    <!-- Content description of the display brightness slider (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_brightness">Display brightness</string>
+9 −0
Original line number Diff line number Diff line
@@ -72,6 +72,15 @@ public class DataSaverTile extends QSTile<QSTile.BooleanState> implements
        return MetricsEvent.QS_DATA_SAVER;
    }

    @Override
    protected String composeChangeAnnouncement() {
        if (mState.value) {
            return mContext.getString(R.string.accessibility_quick_settings_data_saver_changed_on);
        } else {
            return mContext.getString(R.string.accessibility_quick_settings_data_saver_changed_off);
        }
    }

    @Override
    public void onDataSaverChanged(boolean isDataSaving) {
        refreshState(isDataSaving);