Add TtsSpan to schedule-time modes trigger segment so that full day names are read

Bug: 370358575
Test: atest ZenModeTriggerUpdatePreferenceControllerTest + manual with Talkback
Flag: android.app.modes_ui
Change-Id: Ia9ed53c75176d887f26da90a713f1038cf26e01f
This commit is contained in:
Matías Hernández
2024-10-28 12:00:28 +01:00
parent 4e8d11bb40
commit 1e8933123a
2 changed files with 14 additions and 2 deletions

View File

@@ -40,6 +40,7 @@ import androidx.annotation.VisibleForTesting;
import androidx.preference.Preference;
import com.android.settings.R;
import com.android.settings.Utils;
import com.android.settingslib.PrimarySwitchPreference;
import com.android.settingslib.notification.modes.ZenMode;
import com.android.settingslib.notification.modes.ZenModesBackend;
@@ -108,7 +109,9 @@ class ZenModeTriggerUpdatePreferenceController extends AbstractZenModePreference
tryParseScheduleConditionId(mode.getRule().getConditionId());
if (schedule != null) {
preference.setTitle(SystemZenRules.getTimeSummary(mContext, schedule));
preference.setSummary(SystemZenRules.getShortDaysSummary(mContext, schedule));
preference.setSummary(Utils.createAccessibleSequence(
SystemZenRules.getDaysOfWeekShort(mContext, schedule),
SystemZenRules.getDaysOfWeekFull(mContext, schedule)));
} else {
// Fallback, but shouldn't happen.
Log.wtf(TAG, "SCHEDULE_TIME mode without schedule: " + mode);